Re: Search templates: partials

2015-03-24 Thread Zdeněk Šebl
Thanks for info. I am going to open new issue.

-- 
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/338d2bb4-7bf2-4794-abc1-c6aa4a40ad55%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Search templates: partials

2015-03-24 Thread Zdeněk Šebl
I have same troubles now on ES 1.4.4

Did you found solution how to use partials in Mustache file templates?

Thanks,
Zdenek

Dne čtvrtek 7. srpna 2014 20:53:09 UTC+2 Glen Smith napsal(a):

> Developing on v1.2.2, I'm deploying mustache templates by file system 
> under config/scripts.
>
> When I do something like this: 
>
> parent.mustache
>
> {
> "query": {
> "filtered": {
> "query": {
> "bool": {
> "must": [
> {"match_all":{}}
> {{#condition}}
> ,{"match": {"condition": "{{condition}}"}}
> {{/condition}}
> ]
> }
> },
> {{> child}}
> }
> }
> }
>
> child.mustache
>
> "filter": {
> "bool": {
> "must": [
> {"query": {"match_all":{}}}
> {{#status}}
> ,{
> "query": {
> "match": {
> "status": "{{status}}"
> }
> }
> }
> {{/status}}
> ]
> }
> }
>
> I get:
> [2014-08-07 14:48:58,454][WARN ][script   ] [x_node] 
> failed to load/compile script [parent]
> org.elasticsearch.common.mustache.MustacheException: Template 'child' not 
> found
>
> I've tried "pathing" in parent ("scripts/child", "config/scripts/child") 
> with the same result.
>
> Are partials supported?
>
>

-- 
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/6a4af502-4232-4c6c-98cf-a4c414fea3d1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Match phrase and minimum_should_match combination

2015-01-27 Thread Zdeněk Šebl
Hi,
I try to use *ngram* based solution as "shotgun approach" to get results 
which are not covered by more precise analyzers.

Article describing this approach is for example here 


*Match* query, it is working as expected including parameter 
minimum_should_match (this parameter is very important to be able to 
exclude matches of only one ngram from queried word).

*1.* Below is explanation of *match* query searching word *"first"* without

filtered(Text:fir Text:irs Text:rst)->cache(_type:item)

and with "minimum_should_match": "80%"

filtered((Text:fir Text:irs Text:rst)*~2*)->cache(_type:item)

2. But if I try to use the same with *match_phrase* query and phrase *"first 
second"* I'll get the same result with or without minimum_should_match 
parameter

filtered(Text:"(fir irs rst) (sec eco con ond)")->cache(_type:item)

I 'am expecting (for minimum_should_match) something like

filtered(Text:"(fir irs rst)*~2* (sec eco con ond)*~3*")->cache(_type:item)

In attached file, there is complete Marvel Sense code with example 
described above.

*Does anybody know if it is a bug or if it known limitation of used 
technology?*
Or maybe there is another way how to achieve better phrase query results in 
combination with ngram analyzer.

Thanks,
Zdenek

-- 
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/0c637de8-0c27-4097-a94c-88247fa012f2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
PUT /tokenizers
{
  "settings": {
"number_of_shards": 1, 
"number_of_replicas": 0,
"analysis": {
  "filter": {
"trigram": {
  "type": "ngram",
  "min_gram": 3,
  "max_gram": 3
}
  },
  "analyzer": {
"trigram": {
  "tokenizer": "standard",
  "filter": [
"trigram"
  ]
}
}
}
  },
  "mappings": {
"item": {
  "dynamic": "false",
  "properties": {
"Text": {
  "type": "string",
  "analyzer": "trigram"
}
  }
}
  }
}

GET /tokenizers/item/_validate/query?explain
{
  "query": {
"match": {
  "Text": {
"query": "first"
  }
}
  }
}

GET /tokenizers/item/_validate/query?explain
{
  "query": {
"match": {
  "Text": {
"query": "first",
"minimum_should_match": "80%"
  }
}
  }
}

GET /tokenizers/item/_validate/query?explain
{
  "query": {
"match_phrase": {
  "Text": {
"query": "first second"
  }
}
  }
}

GET /tokenizers/item/_validate/query?explain
{
  "query": {
"match_phrase": {
  "Text": {
"query": "first second",
"minimum_should_match": "80%"
  }
}
  }
}