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 Martin Braun <mb...@uni-hd.de> on 2006/08/25 15:26:38 UTC

what do i get with FieldCache.DEFAULT.getStrings(...);

hello,
I am using FieldCache.DEFAULT.getStrings in combination with an own
HitCollector (I loop through all results and count the number of
occurences of a fieldvalue in the results).

My Problem is that I have Filed values like dt.|lat or ger.|eng. an it
seems that only the last token of the fields value is stored in the
returned array of FieldCache.DEFAULT.getStrings(is.getIndexReader(),
category).

But both values are Stored in the Index (I can find dt. and lat.)

The same issue is with another field which contains the word cd-rom an I
get only "rom" back.

Is this an Analyzer Problem? How do I get all tokens?



tia,
martin




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


Re: what do i get with FieldCache.DEFAULT.getStrings(...);

Posted by Chris Hostetter <ho...@fucit.org>.
FieldCache was designed with searching in mind, where there can only be a
single indexed Term for each doc (otherwise how would you sort a doc that
had two Terms "a" and "z" ?)  I'm acctually suprised you are getting any
values out instead of an Exception

If you index your Field as UN_TOKENIZED you should get the resultss you
expect -- but then searching on individual words may not work the way you
expect, adding the data to two differnet fields (on TOKENIZED for
search and one UN_TOKENIZED for sorting/FieldCache) is the typicaly solution.

You also may want to look at hte LazyFieldLoading using the Fieldable APIs
.... they are for accessing the STORED fields of a Document, and are
aparently much faster then the old method of pulling out the whole
Document ... wether they are as fast as FieldCache or not I don't know.


: Date: Fri, 25 Aug 2006 15:26:38 +0200
: From: Martin Braun <mb...@uni-hd.de>
: Reply-To: java-user@lucene.apache.org, mbraun@uni-hd.de
: To: java-user@lucene.apache.org
: Subject: what do i get with FieldCache.DEFAULT.getStrings(...);
:
: hello,
: I am using FieldCache.DEFAULT.getStrings in combination with an own
: HitCollector (I loop through all results and count the number of
: occurences of a fieldvalue in the results).
:
: My Problem is that I have Filed values like dt.|lat or ger.|eng. an it
: seems that only the last token of the fields value is stored in the
: returned array of FieldCache.DEFAULT.getStrings(is.getIndexReader(),
: category).
:
: But both values are Stored in the Index (I can find dt. and lat.)
:
: The same issue is with another field which contains the word cd-rom an I
: get only "rom" back.
:
: Is this an Analyzer Problem? How do I get all tokens?
:
:
:
: tia,
: martin
:
:
:
:
: ---------------------------------------------------------------------
: To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
: For additional commands, e-mail: java-user-help@lucene.apache.org
:



-Hoss


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


Re: what do i get with FieldCache.DEFAULT.getStrings(...);

Posted by Chris Lu <ch...@gmail.com>.
Not sure of the solution though. But FieldCache.DEFAULT.getStrings()
is returning a String[], with one String for each document. Seems your
field is analyzed into multiple String values.

Chris Lu
-------------------------------------------------------
Lucene Search on Any Databases/Applications
http://www.dbsight.net

On 8/25/06, Martin Braun <mb...@uni-hd.de> wrote:
> hello,
> I am using FieldCache.DEFAULT.getStrings in combination with an own
> HitCollector (I loop through all results and count the number of
> occurences of a fieldvalue in the results).
>
> My Problem is that I have Filed values like dt.|lat or ger.|eng. an it
> seems that only the last token of the fields value is stored in the
> returned array of FieldCache.DEFAULT.getStrings(is.getIndexReader(),
> category).
>
> But both values are Stored in the Index (I can find dt. and lat.)
>
> The same issue is with another field which contains the word cd-rom an I
> get only "rom" back.
>
> Is this an Analyzer Problem? How do I get all tokens?
>
>
>
> tia,
> martin
>
>
>
>
> ---------------------------------------------------------------------
> 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