Missed your last email.  Ignore my suggestion and use the raw field:)

On Thu, Mar 13, 2014 at 8:50 AM, Nikolas Everett <nik9...@gmail.com> wrote:

> If you plan to do this frequently then go with the raw field.  It'll be
> faster.
>
> If you want to fool around without changing any mappings then use a script
> filter to get the field from the _source.  It isn't efficient at all.  I'd
> suggest guarding it with a more efficient filter.  Like so:
>
>    "query": {
>       "filtered": {
>          "filter": {
>             "and": [
>                {
>                   "term": {
>                      "title": "filter"
>                   }
>                },
>                {
>                   "script": {
>                      "script": "_source['title'] == 'Filter'"
>                   }
>                }
>             ]
>          }
>       }
>    }
>
>
> Nik
>
>
> On Thu, Mar 13, 2014 at 5:17 AM, Clinton Gormley <cl...@traveljury.com>wrote:
>
>>
>> Appreciate that Clint. But I was asking whether I could do without having
>>> to modify mappings - see ref to another post seemingly alluding to that
>>
>>
>> That post refers to using the keyword_repeat token filter to index
>> stemmed and unstemmed tokens in the same positions. It won't work for your
>> use case for exactly the reasons that you gave before:
>>
>> then _analyze still does not return "bob jr" as one of tokens for text
>>> "bob jr" - guessing because Standard tokenizer splits "bob jr" into "bob"
>>> and "jr" and thus "keyword_repeat" never sees "bob jr".
>>>
>>> On the other hand if I use "keyword" tokenizer than "bob jr" is the sole
>>> token returned (which probably means use case #1 won't be addressable).
>>> Also not clear what purpose would keyword_repeat serve in this case.
>>>
>>
>> Why don't you like the idea of using multi-fields?  It solves your
>> problem correctly and easily.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "elasticsearch" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to elasticsearch+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/elasticsearch/CAPt3XKRYBjVS%2BVu7F3OiRf_mzQg%3DqW20fDvxRV-joiSNKMnqeg%40mail.gmail.com<https://groups.google.com/d/msgid/elasticsearch/CAPt3XKRYBjVS%2BVu7F3OiRf_mzQg%3DqW20fDvxRV-joiSNKMnqeg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elasticsearch+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/CAPmjWd0TF9KDpw4BmiK5xyVZDa6jkhBLd5EMeeaiGGtF4q64Lw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to