Thanks Ian, I'll give it a try!
2012/7/3 Ian Lea
> You can use the QueryParser proximity feature e.g. "foo test"~n where
> n is the max distance you want them to be apart. Or look at the
> SpanQuery stuff e.g. SpanNearQuery.
>
>
> --
> Ian.
>
>
> On Tue, Jul 3, 2012 at 4:59 PM, Jochen Hebbrecht
Where exactly are you using these double quoted strings? QueryParser?
It would help if you showed a code snippet.
Assuming your real data is more complex and the strings you are
searching for aren't necessarily at the start of the text, you'll need
some mix of wildcard and proximity searching.
In fact there is an FAQ entry Can I combine wildcard and phrase
search, e.g. "foo ba*"? at
http://wiki.apache.org/lucene-java/LuceneFAQ#Can_I_combine_wildcard_and_phrase_search.2C_e.g._.22foo_ba.2A.22.3F
which suggests you extend the QueryParser to build a MultiPhraseQuery.
There's also ComplexPhr
Please find the code here
package org.lucenesample;
import org.apache.lucene.search.Query;
import org.apache.lucene.*;
import org.apache.lucene.analysis.*;
import org.apache.lucene.analysis.standard.*;
import org.apache.lucene.analysis.standard.std31.*;
import org.apache.lucene.analysis.tokenattr
You might also consider using the EdgeNGram filter for your documents since
it would index "bar" as both "ba" and "bar" at the same position,
eliminating the need for the use of wildcards. It makes the index bigger,
but eliminates the performance degradation of wildcards. It isn't great for
all
Hi Jack
This needs to be taken care while indexing?Where can i get the code for the
edgegram indexing and then searching.?
-Hiren
On Wed, Jul 4, 2012 at 9:19 PM, Jack Krupansky wrote:
> You might also consider using the EdgeNGram filter for your documents
> since it would index "bar" as both "ba
Here's a Solr field type that supports edge n-grams:
positionIncrementGap="100">
maxGramSize="15" side="front"/>
In Lucene, you would use the EdgeNGramFilter.
This is for Lucene/Solr 3.6.
-- Jack Krupansky
-Original Message-
From: Hiren Shah
Sent: Wednesday, Ju
Oops... that's EdgeNGramTokenFilter in Lucene.
-- Jack Krupansky
-Original Message-
From: Jack Krupansky
Sent: Wednesday, July 04, 2012 4:52 PM
To: java-user@lucene.apache.org
Subject: Re: Starts with Query - Return like search
Here's a Solr field type that supports edge n-grams:
Hey how do we use the MemoryCodec in Solr?
Sent from my Mobile device
720-256-8076
On Jul 3, 2012, at 7:09 AM, Robert Muir wrote:
> 3 July 2012, Apache Luceneā 4.0-alpha available
> The Lucene PMC is pleased to announce the release of Apache Lucene 4.0-alpha
>
> Apache Lucene is a high-perform