FAQ
Hi,

I am using lucene 3.0.1. I use a MultiFieldQueryParser with a
GermanAnalyzer. In my index are some values among others one document
with the title "bauer". I append to every word in my query a ~0.8 (here
I am not sure if this is the way to do it). If I try to search now, I
will not get the document with title "bauer" except I set the fuzzy
value to very low values of about .3.
Do i have to perform two searches with and without the fuzzy parameter
or can I do it somehow in one step like using "bauer~0.8 bauer" as query?
I saw that the parser cuts of the "er" if I am not using the fuzzy
parameter. Can someone please tell my in a few words why? How can I do a
fuzzy search which also finds exact matches?

Thanks,
Markus

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Search Discussions

  • Ahmet Arslan at Jun 12, 2010 at 11:58 am

    I am using lucene 3.0.1. I use a MultiFieldQueryParser with
    a GermanAnalyzer. In my index are some values among others
    one document with the title "bauer". I append to every word
    in my query a ~0.8 (here I am not sure if this is the way to
    do it). If I try to search now, I will not get the document
    with title "bauer" except I set the fuzzy value to very low
    values of about .3.
    Do i have to perform two searches with and without the
    fuzzy parameter or can I do it somehow in one step like
    using "bauer~0.8 bauer" as query?
    Yes bauer~0.8 bauer as query will bring you both exact and fuzzy matches.
    I saw that the parser cuts of the "er" if I am not using
    the fuzzy parameter. Can someone please tell my in a few
    words why?
    This is answer of you question. FuzzyQuery is not analyzed. In your index you have bau, in your query you have bauer. Thats why 0.3 slop is required.
    How can I do a fuzzy search which also finds exact matches?
    removing stemming from your analyzer can work.

    Or org.apache.lucene.queryParser.analyzing.AnalyzingQueryParser should work in your case.







    ---------------------------------------------------------------------
    To unsubscribe, e-mail: [email protected]
    For additional commands, e-mail: [email protected]
  • Markus Mehrwald at Jun 12, 2010 at 3:39 pm

    Am 12.06.2010 13:57, schrieb Ahmet Arslan:
    I am using lucene 3.0.1. I use a MultiFieldQueryParser with
    a GermanAnalyzer. In my index are some values among others
    one document with the title "bauer". I append to every word
    in my query a ~0.8 (here I am not sure if this is the way to
    do it). If I try to search now, I will not get the document
    with title "bauer" except I set the fuzzy value to very low
    values of about .3.
    Do i have to perform two searches with and without the
    fuzzy parameter or can I do it somehow in one step like
    using "bauer~0.8 bauer" as query?
    Yes bauer~0.8 bauer as query will bring you both exact and fuzzy matches.
    Is this the normal way to do it?
    I saw that the parser cuts of the "er" if I am not using
    the fuzzy parameter. Can someone please tell my in a few
    words why?
    This is answer of you question. FuzzyQuery is not analyzed. In your index you have bau, in your query you have bauer. Thats why 0.3 slop is required.
    How can I do a fuzzy search which also finds exact matches?
    removing stemming from your analyzer can work.

    Or org.apache.lucene.queryParser.analyzing.AnalyzingQueryParser should work in your case.
    Unfortunately this parser seems to be missing in 3.0.1






    ---------------------------------------------------------------------
    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]
  • Ahmet Arslan at Jun 12, 2010 at 3:47 pm

    Yes bauer~0.8 bauer as query will bring you both exact
    and fuzzy matches.

    Is this the normal way to do it?
    Somehow. 'bauer~0.8 OR bauer' is easiest way to fuzzy search which also finds exact matches.

    Unfortunately this parser seems to be missing in 3.0.1
    http://lucene.apache.org/java/3_0_1/api/contrib-misc/org/apache/lucene/queryParser/analyzing/AnalyzingQueryParser.html




    ---------------------------------------------------------------------
    To unsubscribe, e-mail: [email protected]
    For additional commands, e-mail: [email protected]

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupjava-user @
categorieslucene
postedJun 12, '10 at 12:54a
activeJun 12, '10 at 3:47p
posts4
users2
websitelucene.apache.org

2 users in discussion

Markus Mehrwald: 2 posts Ahmet Arslan: 2 posts

People

Translate

site design / logo © 2023 Grokbase