Hello, You are performing a search by uri, by default it searches in the _all field. In your case this field doesn't use at all your trigrams analyzer.
You could either pass an explicit query : {"query": {...} }, or specify which field you want to match: curl -XGET 'http://localhost:9200/urls/_search?q=jen&analyzer=trigrams&pretty=true&df=title' I think it works for "jen*" because it's converted into a wildcard query. For the termvectors, you have to enable them in your mapping: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-core-types.html#string Cédric Hourcade c...@wal.fr On Tue, Jun 24, 2014 at 12:47 PM, Andreas Falk <adde.f...@gmail.com> wrote: > Hey, > > I'm trying to get a trigram analyzer working but i'm fairly sure i'm doing > something wrong because as i understand it it doesn't generate any terms at > all for my document. I've done a complete log with curl commands of what i'm > doing here: https://gist.github.com/luuse/cb707b85c73f8e82cd8d > > 1. So i start with creating the index and at the same time i add the > analyzer and a mapping for all fields in my document. The response when i > create it is in create.json and the body i send is in mapping.json. > 2. I index the document in url.json and get the response in index.json > 3. I get the termvector in termvector.json > 4. I query it with "jen" and the analyzer trigrams figuring it should match > against "jenkins" but no results > 5. I query it with "jen*" and still the analyzer trigrams and get the > jenkins result > > So I have two questions... > > a. When i fetch the termvector it looks like it empty. Is this correct? > b. Have i missed some detail or what am i doing wrong? Why isn't it working? > > I can provide more details if you want. I'm running v1.2.1 in a docker > container. > > Cheers > Andreas > > -- > 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/e4fef398-0941-4471-8efa-a97878fcb210%40googlegroups.com. > 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/CAJQxjPM_j2EzFnLrLwXkdFV8GJ8WonedystnwiOw%3DDmCQasACQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.