FAQ
Hi all,

It's possible to use simplely (without java preprocessing, if possible)
Lucene to find items with this constraints:

I have indexed this word : clamoxyle
I want to find it with this queries : claomxyle, clamoxile, camoxyle.

It is possible?

Thank you,
Ulrich.

Search Discussions

  • Erick Erickson at Feb 12, 2008 at 2:59 pm
    You should probably think about synonym analyzers, both at index
    time and query time. Because I think you have a problem here....

    Let's say you can do what you ask, at query time transform
    any of your three options into "clamoxyle". Would it really
    be satisfactory to your users to then NOT get any matches on
    documents containing "claomxyle" or "clamoxile"? It seems to
    me that this would be unsatisfactory.

    Erick
    On Feb 12, 2008 7:56 AM, Ulrich Vachon wrote:

    Hi all,

    It's possible to use simplely (without java preprocessing, if possible)
    Lucene to find items with this constraints:

    I have indexed this word : clamoxyle
    I want to find it with this queries : claomxyle, clamoxile, camoxyle.

    It is possible?

    Thank you,
    Ulrich.
  • Patrick at Feb 12, 2008 at 4:18 pm
    Did you take a look at the
    org.apache.lucene.analysis.ngram.NGramTokenFilter? Or other ngram
    implementation? Works great for us.

    Patrick

    Ulrich Vachon wrote:
    Hi all,

    It's possible to use simplely (without java preprocessing, if possible)
    Lucene to find items with this constraints:

    I have indexed this word : clamoxyle
    I want to find it with this queries : claomxyle, clamoxile, camoxyle.

    It is possible?

    Thank you,
    Ulrich.

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org
  • Ulrich Vachon at Feb 13, 2008 at 9:54 am
    Thank you for your responses.

    But i'm very surprised to see the FuzzyQuery used in my junit test work at 100%. I must only to determine if this simple algo work with full data.

    <code>
    RAMDirectory directory = new RAMDirectory();
    IndexWriter writer = new IndexWriter(directory, new MyAnalyzer(), true);
    addDoc("aspegic", writer);
    addDoc("clamoxyl", writer);

    writer.optimize();
    writer.close();
    IndexSearcher searcher = new IndexSearcher(directory);

    Query query = new FuzzyQuery(new Term("field", "claomxyle"), 0.6f);
    hits = searcher.search(query);
    assertEquals(1, hits.length());
    query = new FuzzyQuery(new Term("field", "clamoxile"), 0.6f);
    hits = searcher.search(query);
    assertEquals(1, hits.length());
    query = new FuzzyQuery(new Term("field", "camoxyle"), 0.60f);
    hits = searcher.search(query);
    assertEquals(1, hits.length());
    query = new FuzzyQuery(new Term("field", "clamoxil"), 0.60f);
    hits = searcher.search(query);
    assertEquals(1, hits.length());
    </code>

    Regards,
    Ulrich/


    -----Message d'origine-----
    De : Erick Erickson
    Envoyé : mardi 12 février 2008 15:58
    À : java-user@lucene.apache.org
    Objet : Re: Inverted letters

    You should probably think about synonym analyzers, both at index time and query time. Because I think you have a problem here....

    Let's say you can do what you ask, at query time transform any of your three options into "clamoxyle". Would it really be satisfactory to your users to then NOT get any matches on documents containing "claomxyle" or "clamoxile"? It seems to me that this would be unsatisfactory.

    Erick
    On Feb 12, 2008 7:56 AM, Ulrich Vachon wrote:

    Hi all,

    It's possible to use simplely (without java preprocessing, if
    possible) Lucene to find items with this constraints:

    I have indexed this word : clamoxyle
    I want to find it with this queries : claomxyle, clamoxile, camoxyle.

    It is possible?

    Thank you,
    Ulrich.

    ______________________________________________________________________
    Cet e-mail a été scanné par MessageLabs Email Security System.
    Pour plus d'informations, visitez http://www.messagelabs.com/email ______________________________________________________________________

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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupjava-user @
categorieslucene
postedFeb 12, '08 at 12:56p
activeFeb 13, '08 at 9:54a
posts4
users3
websitelucene.apache.org

People

Translate

site design / logo © 2022 Grokbase