Hi Aliaksandr,

Aliaksandr Radzivanovich wrote:
> What if I need to search for synonyms, but synonyms can be expanded to
> phrases of several words?
> For example, user enters query "tcp", then my application should also
> find documents containing phrase "Transmission Control Protocol". And
> conversely, user enters "Transmission Control Protocol", then my
> application should also find documents with word "tcp".

Section 4.6 of Gospodnetić & Hatcher's excellent _Lucene_in_Action_[1]
describes a SynonymAnalyzer class, intended for use at indexing time
(AFACT, however, their approach does not address multi-word synonyms).
Although a query-time analyzer is not directly discussed, they do say
(on p. 134):

   The awkwardly named PhrasePrefixQuery (see section 5.2)
   is one option to consider, perhaps created through an
   overridden QueryParser.getFieldQuery method; this is a
   possible option to explore if you wish to implement
   synonym injection at query time.

Steve

[1] http://lucenebook.com/

-- 
Steve Rowe
Center for Natural Language Processing
http://www.cnlp.org/tech/lucene.asp

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to