Hello,

I want to search through the indexed documents with the following query.
e.g.

"+field1:abc AND -field2:def AND +field3:xyz"

My code looks as below -

my $q = "+field1:abc AND -field3:def AND +field3:xyz";

my $searcher = Lucy::Search::IndexSearcher->new(
       index => $path_to_index,
);

my $qparser = Lucy::Search::QueryParser->new(
       schema => $searcher->get_schema,
);

my $query = $qparser->parse($q);

my $hits = $searcher->hits(
       query => $query,
       offset => $offset,
      num_wanted => $page_size,
);

I read the info on the link
https://metacpan.org/module/Lucy::Search::QueryParser#___pod

It says that I need to use a method set_heed_colons(). But I am not able to
figure out how many arguments should be provided to the method?
What exactly does set_heed_colon method do?

I supplied argument '3' because my query string contained 3 fields.
Surprisingly my code worked but I don't know how.
Can anybody please throw light on this?

Also where can I find the wildcard characters supported by Lucy query
parser? A lot of wildcard characters have been supported by Lucene.
What do I need to specify in the query string if I need all the documents
present. (e.g. * wildcard character or something like that)

Thank you.

Reply via email to