Database LIKE 'something mor%' query

We want to get elasticsearch to search for us exactly as database LIKE
'something mor%' query does and with highlights in particular case.
Any ideas?

On Tue, Oct 11, 2011 at 6:10 PM, Alexander Nemsadze
alexander.nemsadze@azry.com wrote:

We want to get elasticsearch to search for us exactly as database LIKE
'something mor%' query does and with highlights in particular case.
Any ideas?

Elasticsearch supports "more like this" queries. More details -

Regards,
BG

--
Baishampayan Ghose
b.ghose at gmail.com

If you're just talking about finding things starting with a given string, like:

some_field LIKE 'something mor%'
some_field LIKE 'first second %'
some_field LIKE 'another cas%'

You should check out prefix queries:

Does that help?

Cheers,
Chris

On Tue, Oct 11, 2011 at 8:40 PM, Alexander Nemsadze
alexander.nemsadze@azry.com wrote:

We want to get elasticsearch to search for us exactly as database LIKE
'something mor%' query does and with highlights in particular case.
Any ideas?

for best performance you'll need to use (edge)ngram filter/tokenizer
for indexing

  • prefix query or 'something mor*' query_string queries

On 11 Okt., 14:40, Alexander Nemsadze alexander.nemsa...@azry.com
wrote:

We want to get elasticsearch to search for us exactly as database LIKE
'something mor%' query does and with highlights in particular case.
Any ideas?

Unfortunately prefix works only for one word.

some_field LIKE 'somet%' - Works
some_field LIKE 'something mor%' - Does not work
some_field LIKE 'something more%' - Also does not work

On Oct 11, 4:48 pm, Chris Berkhout chrisberkh...@gmail.com wrote:

If you're just talking about finding things starting with a given string, like:

some_field LIKE 'something mor%'
some_field LIKE 'first second %'
some_field LIKE 'another cas%'

You should check out prefix queries:Elasticsearch Platform — Find real-time answers at scale | Elastic

Does that help?

Cheers,
Chris

On Tue, Oct 11, 2011 at 8:40 PM, Alexander Nemsadze

alexander.nemsa...@azry.com wrote:

We want to get elasticsearch to search for us exactly as database LIKE
'something mor%' query does and with highlights in particular case.
Any ideas?

On Tue, Oct 11, 2011 at 5:14 PM, Alexander Nemsadze <
alexander.nemsadze@azry.com> wrote:

Unfortunately prefix works only for one word.

I guess you shoud use a not analyzed field.

some_field LIKE 'somet%' - Works
some_field LIKE 'something mor%' - Does not work
some_field LIKE 'something more%' - Also does not work

On Oct 11, 4:48 pm, Chris Berkhout chrisberkh...@gmail.com wrote:

If you're just talking about finding things starting with a given string,
like:

some_field LIKE 'something mor%'
some_field LIKE 'first second %'
some_field LIKE 'another cas%'

You should check out prefix queries:
Elasticsearch Platform — Find real-time answers at scale | Elastic

Does that help?

Cheers,
Chris

On Tue, Oct 11, 2011 at 8:40 PM, Alexander Nemsadze

alexander.nemsa...@azry.com wrote:

We want to get elasticsearch to search for us exactly as database LIKE
'something mor%' query does and with highlights in particular case.
Any ideas?

--
http://www.sfgdornbirn.at
http://www.mcb-bregenz.at