lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emanuel Buzek <emanuel.bu...@roke.cz>
Subject Re: How to locate a Phrase inside text (like a Browser text searcher)
Date Thu, 15 May 2014 21:16:59 GMT
Hi Teko,
sure - I use Lucene though elasticsearch, but I suppose that doesnt make a
difference in this situation. I needed something like what you were trying
to accomplish - basically to search any substring... wildcarded queries
worked but were kind of slow.

This is my analyzer that works for me perfectly:
"settings" : {
    "analysis" : {
      "analyzer" : {
        "default" : {
          "type" : "custom",
          "filter" : ["icu_folding"],
    "tokenizer" : "nGram"
        }
      },
      "tokenizer": {
      "nGram" : {
    "type" : "nGram",
    "min_gram" : 2,
    "max_gram" : 20,
    "token_chars" : ["letter", "digit", "punctuation", "symbol"]
}
        }
    }
    },

it basically indexes any substrings made of letters, digits, punctuation
and symbols of length 2..20.

but if that previous solution works for you, that's good :)


2014-05-14 20:23 GMT+02:00 teko <tecozc@gmail.com>:

> *Emanuel Buzek,
>
> Can you explain how you use NGram?? Did you create a Analyzer? is it??
> Sorry, but, I really don't have a great knowledge about Lucene...
>
> Thank advance!
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/SOLVED-How-to-locate-a-Phrase-inside-text-like-a-Browser-text-searcher-tp4135075p4135607.html
> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>


-- 
Emanuel Buzek
Software Engineer, ROKE.cz <http://www.roke.cz>
tel: +420 776 54 26 26

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message