Great, will try this.
Thanks Peter.

________________________________
 From: Peter Karman <[email protected]>
To: [email protected] 
Sent: Thursday, December 27, 2012 9:54 PM
Subject: Re: [lucy-user] query parsing
 
Anil Pachuri wrote on 12/27/12 2:06 PM:
> Hi,
> 
> 
> I was wondering how I could use Lucy for the following example: a phrase 
> query "baby diaper color" is able to match the following phrases in the 
> documents:
> 
> baby's diaper color
> baby diaper's color
> color of baby diaper
> color of the baby diaper
> coloring of baby diaper
> color of the diaper of the baby
> baby diaper colour (with extra 'u')
> baby diaper including color
> baby diaper with color
> 
> I tried to explore Lucy phrasequery parser for this but it looks like 
> phrasequery parser may not work entirely in this case due to its strict word 
> order rule. I am not sure if I need to pass those phrases to Lucy as explicit 
> synonyms in some way, or is there is better way? Please advise.
> 

You might want to try the Search::Query::Parser with the term_expander feature
and the Lucy dialect:

https://metacpan.org/module/Search::Query::Parser

You probably also want to use LucyX::Search::ProximityQuery instead of
PhraseQuery, since ProximityQuery will allow for different word orders.


-- 
Peter Karman  .  http://peknet.com/ [email protected]

Reply via email to