lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Walter Ferrara <walter.ferr...@ecomware.it>
Subject Re: regaridng Reader.terms()
Date Tue, 22 May 2007 10:51:42 GMT
Let's suppose you modify your WhitespaceAnalyzer not to use a
WhitespaceTokenizer, but a modified version of the Tokenizer which
token-ize not by space but by something else, like '/'. (this is just an
example of course).
So suppose your real txt document contain :
/text2 text3/text4 text5/text6
When you add this document to the index using the tokenizer I explained,
terms returned by indexreader.terms should be:
text2 text3
text4 text5
text6


Mohammad Norouzi wrote:
> Walter,
> Yes I am using a customized WhiteSpaceAnalyzer while indexing.
> I said customized because I realized that standard WhiteSpaceAnalyzer
> dont
> accept unicode terms in my language so I make some change to support
> that.
>
> but for reading no Analyzer is used
>
> if I want to get that result, which analyzer should I use?
>
> in my case, I dont need any boost factor or any other feature of
> lucene, I
> need just searching through the index.
>
>
> On 5/22/07, Walter Ferrara <walter.ferrara@ecomware.it> wrote:
>>
>> If Reader.terms() gives you:
>> text3
>> text4
>> while you expect
>> text3 text4
>>
>> you should change, I presume, the Analyzer, maybe writing your own one.
>>
>> Mohammad Norouzi wrote:
>> > Hi all
>> >
>> > consider following index
>> >
>> > field1           field2                              field3
>> > text1           text1 text2                      text3 text4
>> > text4           text2                              text2 text3 text5
>> >
>> > I want to get all terms in filed3
>> > if I use Reader.terms() it will returns: (however i have to put an if
>> > statement to filter result of the field3 only)
>> > text3
>> > text4
>> > text2
>> > text5
>> >
>> > but I need following result:
>> > "text3 text4"
>> > "text2 text3 text5"
>> >
>> >
>> > is this possible? if yes, how? and if no, is there any tricky way
>> to get
>> > this result?
>> >
>> > thank you so much.
>> >
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message