You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Timon Roth <ti...@digitalforce.ch> on 2009/05/20 22:44:40 UTC

read between the lines of an index

dear list

i want to add a entry to an index with a custom synomlist to an index. for 
example with the following text:

[i worrie about nothing beacuse this worls is crazy]

and i want to add the two custom synonyms

[anything]=>[nothing] 
and 
[lazy]=>[crazy]

so that a search for lazy, crazy nothing and anything gives me a hit to the 
entry in the index.

the point is, that prasesearch must still work. for exapmple when im searching 
for:

"this world is crazy" or "i worrie about nothing" must result in a hit, and i 
cannot just paste the sysnonyms after the existing words like this:

[i worrie about nothing anything beacuse this worls is crazy lazy]

how ca i do this? is there a possibility to insert more then one word at the 
same position?

gruess,
timon

-- 
Timon Roth
Triemlistrasse 92
8047 Zürich
--
043 817 40 31
079 636 57 28
--
digitalforce.ch
timon.roth@digitalforce.ch
http://tel.search.ch/zuerich/triemlistrasse-92/timon-roth

Re: read between the lines of an index

Posted by Erick Erickson <er...@gmail.com>.
The Lucene In Action book (at least the first edition and, I presume, the
second)
has exactly this, called SynonymAnalyzer. The basic idea is that at index
time
you index your multiple terms with no increment between, so all your
synonyms
get indexed in the same position.

I highly recommend the book, especially since you can just copy the code
<G>...

Best
Erick

On Wed, May 20, 2009 at 4:44 PM, Timon Roth <ti...@digitalforce.ch>wrote:

> dear list
>
> i want to add a entry to an index with a custom synomlist to an index. for
> example with the following text:
>
> [i worrie about nothing beacuse this worls is crazy]
>
> and i want to add the two custom synonyms
>
> [anything]=>[nothing]
> and
> [lazy]=>[crazy]
>
> so that a search for lazy, crazy nothing and anything gives me a hit to the
> entry in the index.
>
> the point is, that prasesearch must still work. for exapmple when im
> searching
> for:
>
> "this world is crazy" or "i worrie about nothing" must result in a hit, and
> i
> cannot just paste the sysnonyms after the existing words like this:
>
> [i worrie about nothing anything beacuse this worls is crazy lazy]
>
> how ca i do this? is there a possibility to insert more then one word at
> the
> same position?
>
> gruess,
> timon
>
> --
> Timon Roth
> Triemlistrasse 92
> 8047 Zürich
> --
> 043 817 40 31
> 079 636 57 28
> --
> digitalforce.ch
> timon.roth@digitalforce.ch
> http://tel.search.ch/zuerich/triemlistrasse-92/timon-roth
>