On 22-Nov-07, at 8:49 AM, Nicolas Lalevée wrote:
Le jeudi 22 novembre 2007, Matthijs Bierman a écrit :
Hi Nicolas,
Why can't you extend the QueryParser and override the methods you
want
to modify?
Because the query parser I would like to have is a very basic user
one, ala
google. The s
Hello,
as a prolog, i have no problems and everything works the way i want :-)
I am more interested in a tip if i am using the right way or pattern.
I want to strip accents before data goes into my index, so i wrote
the code following below. I did not find an example of where to place
a fi
Hi
Simply create your own analyzer with JavaCC. See the repository for the
latest StandardAnalyzer.jj file, make sure the Analyzer accepts anything
with a hypen as a single token.
And try not to yell, please. Most of the questions are urgent, there is
no need for emphasis - especially in this
Le jeudi 22 novembre 2007, Matthijs Bierman a écrit :
> Hi Nicolas,
>
> Why can't you extend the QueryParser and override the methods you want
> to modify?
Because the query parser I would like to have is a very basic user one, ala
google. The syntax I would like is nothing more than :
"type:text
Yep - that's a good one. Only it may be a very heavy query, and throw
TooManyClausesException, if the number of terms that start with the prefix
is too much. But that certainly would work.
BTW - MultiPhraseQuery's documentation specifically explains how to use it
for exactly the same purpose.
On N
The thing is - StandardAnalyzer breaks on hyphen. You'll need to work around
this by either extend StandardAnalyzer
>From StandardTokenizer's documentation (which is used by StandardAnalyzer):
**Splits words at hyphens, unless there's a number in the token, in
which case
* the whole token
>>Re: help required urgent!!!
Yikes!!
I'm guessing that the question was more about how to support this in the
standard query syntax where there are multiple words.
i.e. http://www.google.com/search?q=lucene+wildcard+in+phrase
This post seems close
Hi
I wrote the following class:
public class AlwaysPrefixMultiFieldQP extends MultiFieldQueryParser {
public MyQP(String[] fields, Analyzer analyzer) {
super(fields, analyzer);
}
protected Query getFieldQuery(String field, String queryText) throws
ParseEx
Hi
But the file I am indexing is very big and I don't know which word will
contain the hyphen. The thing you suggest can be implemented only if
there are some specific words in the file.
Apart from StandardAnalyzer I have got no option.
Thanks a lot for your reply.
Please suggest me how can I g
Hi
You can simply create a PrefixQuery. However, if you're using
StandardAnalyzer, and the word is added as Index.TOKENIZED,
sotf-wa will be broken to 'soft' and 'wa'. Therefore
you'll need to add the word as Index.UN_TOKENIZED, or use a different
Analyzer when you index the data (for this field a
Hi
I am using StandardAnalyser() to index the data.
But I want to do a like search on a word containing Hyphen
For example it want to search a word "soft-wa*"
I am getting no hits for that. It is said that if the hyphen is there in
the word, then we should include that word in the double quotes (
How about using MultiFieldQueryParser. Here is a short main I wrote:
Directory dir = new RAMDirectory();
Analyzer analyzer = new StandardAnalyzer();
IndexWriter writer = new IndexWriter(dir, analyzer);
Document doc = new Document();
doc.add(new Field("field1
The simplest way would be to pre-process the query. That
is, just split on words and add the '*' as appropriate.
Erick
On Nov 21, 2007 2:16 PM, Anders Lybecker <[EMAIL PROTECTED]> wrote:
> How do I force the MultiFieldQueryParser to interpret a string like
> "dock boat" as "dock* boat*" and ther
The semantics of the phrase query you're constructing probably aren't
what you think. As best I can infer, you are trying to do something
like
"green tree" in field1
or
"green tree" in field 2
but that's not even close to what you're constructing.
It would help a show what the query you want is
There is no option to provide an Occur.SHOULD to the PhraseQuery. So where
does it go? I changed the source to look like this:
PhraseQuery pq = new PhraseQuery();
for (String word : words) {
for (String field : fields) {
pq.add(new Term(field, word));
}
}
Hits hits
On Donnerstag, 22. November 2007, Rapthor wrote:
> I want to realize a search that finds the exact phrase I provide.
You simply need to create a PhraseQuery.
See
http://lucene.zones.apache.org:8080/hudson/job/Lucene-Nightly/javadoc/org/apache/lucene/search/PhraseQuery.html
Regards
Daniel
--
Hi,
I want to realize a search that finds the exact phrase I provide. If the
word I am searching for is "green tree", I do NOT want to get results for
"green" or "tree", but only results for "green tree" within the given field.
This doesn't work so far for me. When providing a word that contains
Hi Nicolas,
Why can't you extend the QueryParser and override the methods you want
to modify?
Cheers,
Matthijs
Nicolas Lalevée wrote:
Hi,
I am willing to have a query parser which is fault tolerant. I have search
over the archive, and I have found this :
http://www.nabble.com/Error-tolera
18 matches
Mail list logo