Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PUT compound_test
- {
- "settings": {
- "analysis": {
- "filter": {
- "nGram_3": {
- "type": "nGram",
- "min_gram": "3",
- "max_gram": "3"
- }
- },
- "analyzer": {
- "trigrams": {
- "type": "custom",
- "filter": [
- "nGram_3"
- ],
- "tokenizer": "whitespace"
- }
- }
- }
- },
- "mappings": {
- "doc": {
- "properties": {
- "content": {
- "type": "text",
- "analyzer": "trigrams"
- }
- }
- }
- }
- }
- POST /compound_test/doc/_bulk
- { "index": { "_id": 1 }}
- { "content": "elasticsearch is awesome" }
- { "index": { "_id": 2 }}
- { "content": "some search queries dont perform good" }
- # this will return both documents. This is not what I want
- GET compound_test/_search
- {
- "query": {
- "match": {
- "content": {
- "query": "awesome search",
- "minimum_should_match": "100%"
- }
- }
- }
- }
- # this is what I actually want, without writing it that way / preanalyzing it on client side
- GET compound_test/_search
- {
- "query": {
- "match": {
- "content": {
- "query": "awe wes eso ome sea ear arc rch",
- "analyzer": "whitespace",
- "minimum_should_match": "100%"
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement