Possibly your content was tokenized when it was indexed, splitting up strings containing hyphens, so if the url was "multiple-word", the indexed field looks like "multiple word". If you can find out what tokenizer (if any) was used when indexing the url field, you could do something like (pseudocode)

tokens = tokenize(wordtosearch)
for t in token
  query.addRequiredTerm(token,"url")
// should also add some restrictions that require the tokens to be in the same order

if you want to see how this stuff works you can use Luke on your index -- you'll also see it has some pre-packaged Analyzers that can do the kind of stuff in the pseudocode above.

Hope this helps,

Jasper

On May 20, 2008, at 12:04 AM, pavankumar wrote:


Hi,
       I want to filter out search results such that only urls with a
specific word in the "url" field should be present in the output. If the word to search for in the "url" field has a hyphen(-), we are not getting
any results.
I am using the following code snippet.

query.addRequiredTerm(<wordtosearch>, "url");
hits = bean.search(query, Short.MAX_VALUE);

if the <wordtosearch> has a hyphen in it, no results are obtained.
Please help me on solving this issue.

--
View this message in context: http://www.nabble.com/Nutch-Query-not- giving-required-results-tp17334490p17334490.html
Sent from the Nutch - User mailing list archive at Nabble.com.



Reply via email to