Hi all
here is what I have been trying and the problem
I am trying to see how many times a single word appears in a field.
Basically, I have a field called universal, and lets say the field is like
this:
car house road age sex school education education tree garden
and I am searching useing the word education so I am expecting 2 as my
result.
I have did the configurations on
http://wiki.apache.org/solr/TermVectorComponent and my piece code is this :
TermFreqVector vector = this.reader.getTermFreqVector(this.docId,
universal);
int index = vector.indexOf(education);
int freq = vector.getTermFrequencies()[index];
but here as vector.indexOf(education); returns -1 i got an error.
in addition, i have tried this too:
TermFreqVector vector = reader.getTermFreqVector(this.docId, universal);
String universalTerms[] = vector.getTerms();
to see the lenght of universalTerms array, and it is 1 and only value that
array stores is the field value:
universalTerms[0]= car house road age sex school education education tree
garden
anyone can help me with this?
-
Zeki ama calismiyor... Calissa yapar...
--
View this message in context:
http://lucene.472066.n3.nabble.com/TermFreqVector-Problem-tp2992163p2992163.html
Sent from the Solr - User mailing list archive at Nabble.com.