11 jul 2008 kl. 15.28 skrev jnance:
The TermFrequencyVector works perfectly for normal query strings.
But if I
add a wild card (*) onto words to search for different forms of the
word I
get an ArrayIndexOutOfBoundsException because the index is -1. Why
does this
happen? And is there anyw
ot;, new
>>>> StandardAnalyzer());
>>>> Query query = parser.parse(queryString);
>>>> Hits hits = searcher.search(query);
>>>>
>>>> int hitCount = hits.length();
>>>>
t; System.out.println("0 documents contain the word
>>> \"" + queryString +
>>> ".\"");
>>> }
>>> else {
>>> System
gt; }
>> else {
>> System.out.println(hitCount + " documents contain
>> the word \"" +
>> queryString + ".\"");
>> }
>> }
>>
>> This tells me how
+ " documents contain the word
\"" +
queryString + ".\"");
}
}
This tells me how many documents contain the word I'm looking for...
but how
do I get it to tell me how many times the word occurs within that
document?
Thanks,
James
--
Ok, I'll see if I can find anything.
Thanks,
James
--
View this message in context:
http://www.nabble.com/Searching-for-instances-within-a-document-tp18362075p18362432.html
Sent from the Lucene - Java Users mailing list archive at Nabbl
d \"" +
> queryString + ".\"");
> }
> }
>
> This tells me how many documents contain the word I'm looking for... but
> how
> do I get it to tell me how many times the word occurs within that document?
>
> Thanks,
t;);
}
}
This tells me how many documents contain the word I'm looking for... but how
do I get it to tell me how many times the word occurs within that document?
Thanks,
James
--
View this message in context:
http://www.nabble.com/Searching-for-instances-with