You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Chris Hostetter <ho...@fucit.org> on 2013/02/11 19:22:15 UTC

A bit stuck on index and search (v4.1.0) (FWD)

The message below sat un-attended in the moderation queue for so long it
was automatically rejected.  I'm resending it on the OP's behalf

-Hoss

---------- Forwarded message ----------
From: dm_tim
Date: Mon, 4 Feb 2013 17:39:53 -0800 (PST)
Subject: A bit stuck on index and search (v4.1.0)

Howdy,

I am attempting to create an index and query that uses my own analyzer. 
The
analyzer uses the WhitespaceTokenizer and the LowerCaseFilter only. I have 
a
simple test that takes an array of strings and returns the tokens that 
this
analyzer creates and they look ok:
"Red Lobster" becomes "red", "lobster"
"The Gap" becomes "the", "gap"
"BillyBob@thornton.com" becomes "billybob@thornton.com"

So then I index a bunch of data that includes "Office Max" in a TextField 
I
call "name" and then I do a search that uses the same analyzer and I send
the following queries:
name:office             => returns no hits
name:max               => returns no hits
name:office max      => returns no hits
name:"office max"~  => returns no hits
name:office~          => returns hits (including the data I'm after)
name:max~            => returns hits (including the data I'm after)
name:office*          => returns hits (including the data I'm after)
name:*max             => returns hits (including the data I'm after)

OK, so what I was hoping for was to be able to enter the entire search
phrase "office max" and get hits. I'm unsure why that doesn't happen here.

Also I would like to boost hits that contain exact matches for either term
("office" or "max") but am unsure how to make that work. I could use a
technical assist if possible.

Regards,

Tim


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