Hi
I wnat to use Xapian to use Fulltext search on my Database application
I could index my Database Objects an can search for simple Pattern
I have set an Id Value by
$doc->add_value($this->ENTITY_ID, $entityId);
to retrive my Db-Identifiers of the Search results
also a added a Prefixed term
$doc->add_term("T".$entityTyp);
to be able to do search queries like "type:document"
therfore I set the Prefix to the QueryParser befor parsing the Query
$parser = new XapianQueryParser();
$parser->add_prefix("type", "T");
$parser->set_stemmer($stemmer);
$parser->set_stemming_strategy(XapianQueryParser::STEM_SOME);
$parser->set_database($this->xapianDb);
$queryParsed = $parser->parse_query($pattern,
$this->DEFAULT_SEARCH_FLAGS);
So.. this all works if i search "type:document " OR any simple query
(e.g. "backup"), but not the i want to search
"backup AND type:document". Doing so i always get an empty result set.
Has anyonone an idea why, and how this problem can be solved?
XapianQueryParser::FLAG_BOOLEAN is set.
Thanks for your help
--
Corvent GmbH
Anton Graff-Strasse 15
CH-8400 Winterthur
Telefon: 052 242 34 75
On Mon, Sep 08, 2008 at 05:54:22PM +0200, Manuel K?gi wrote:> $parser = new XapianQueryParser(); > $parser->add_prefix("type", "T");I think you want add_boolean_prefix here rather than add_prefix.> $parser->set_stemmer($stemmer); > $parser->set_stemming_strategy(XapianQueryParser::STEM_SOME); > $parser->set_database($this->xapianDb); > $queryParsed = $parser->parse_query($pattern, > $this->DEFAULT_SEARCH_FLAGS); > > So.. this all works if i search "type:document " OR any simple query > (e.g. "backup"), but not the i want to search > "backup AND type:document". Doing so i always get an empty result set.For tips in debugging such cases, see: http://trac.xapian.org/wiki/FAQ/NoMatches Cheers, Olly