But it is not exactly 1 term off, which is what Jochen wants. *shrug*
Erik
On Mar 4, 2004, at 6:22 PM, Otis Gospodnetic wrote:
Ah, sorry, I had misread your email, thinking you were asking a way to match a single character. The only thing that comes to my tired mind now is a phrase query with a slop of 1, but that doesn't gurantee order, I believe.
Otis
--- Jochen Frey <[EMAIL PROTECTED]> wrote:Otis:
Maybe I don't understand this right, but I *think* I am looking for something different:
I am trying to write a query like this: "my * house" which should match "my own house", "my red house", "my small house", but should not match "my house" ... you get the idea.
If I am not mistaken, a wildcard query only works if the wildcard is within a word (or token), and it would allow me to do things like "g*" matching "green", "great", ...etc. I don't know how to make that work for multi words scenarios.
Here is what I tried WildcardQuery in the unit test (TestBasics):
Query query = new WildcardQuery(new Term("field","six hundred * five"));
Thanks! Jochen
-----Original Message----- From: Otis Gospodnetic [mailto:[EMAIL PROTECTED] Sent: Thursday, March 04, 2004 12:00 PM To: Lucene Users List Subject: Re: Query: A ? B
Use WildcardQuery: A?B
Otis
--- Jochen Frey <[EMAIL PROTECTED]> wrote:Hi Everyone.(just
I am trying to figure out how create a query that matches
A ? B
Where ? is exactly one token. Can anyone tell me how to do that?
Obviously it's easy to match 'A * B' where '*' is 0 or 1 tokenslikeuse a PhraseQuery and set slop to 1). However, if I require exactly one word/token between 'A' and 'B'?
BTW, I know a very clumsy way of doing this, but I really don't---------------------------------------------------------------------it: For each indexed token insert a token (for example 'X') at the same token-position. Then the query would be: "A X B" and everybody (except the indexing performance as well as the size on disk) would be happy.
There's got to be an easier way. Right?
Thanks in advance! Jochen
[EMAIL PROTECTED]To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail:
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
