William
(William)
July 18, 2013, 4:06pm
1
I am using ElasticSearch (with the Tire gem). I have the following query
which will match escaped cat, escaped black cat, etc.
I was wondering, is it possible to ask ElasticSearch to search with the
following criteria:
"escaped [exactly 0 or 1 word] cat" ie) escaped \w{0,1} cat
"escaped [n words] cat" ie) escaped \w{n} cat
"escaped [Regular expression here] cat" ie) escaped (big|black|white)
cat
Thanks
Current searching query:
{
"query": {
"bool": {
"should": [
{
"query_string": {
"query": ""escaped ? cat"",
"analyzer": "snowball"
}
},
{
"query_string": {
"query": ""escaped ? cat"",
"default_operator": "and"
}
},
{
"flt_field": {
"content": {
"like_text": ""escaped ? cat""
}
}
},
{
"mlt_field": {
"content": {
"like_text": ""escaped ? cat""
}
}
}
]
}
}}
--
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+unsubscribe@googlegroups.com .
For more options, visit https://groups.google.com/groups/opt_out .
spinscale
(Alexander Reelsen)
July 19, 2013, 6:17am
2
Hey,
the slop parameter might help you in your first two cases. (Search for slop
on the .org documentation, it is mentioned in the match and in the
query_string query at least). Your regular expression case might be
solvable with the regexp filter, but it might be to slow. You might be able
to work around by using a bool query and the minimum_should_match parameter
Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.
Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.
I am afraid I cannot help you with Tire though...
--Alex
On Thu, Jul 18, 2013 at 6:06 PM, William bill@theworkinggroup.ca wrote:
I am using Elasticsearch (with the Tire gem). I have the following query
which will match escaped cat, escaped black cat, etc.
I was wondering, is it possible to ask Elasticsearch to search with the
following criteria:
"escaped [exactly 0 or 1 word] cat" ie) escaped \w{0,1} cat
"escaped [n words] cat" ie) escaped \w{n} cat
"escaped [Regular expression here] cat" ie) escaped
(big|black|white) cat
Thanks
Current searching query:
{
"query": {
"bool": {
"should": [
{
"query_string": {
"query": ""escaped ? cat"",
"analyzer": "snowball"
}
},
{
"query_string": {
"query": ""escaped ? cat"",
"default_operator": "and"
}
},
{
"flt_field": {
"content": {
"like_text": ""escaped ? cat""
}
}
},
{
"mlt_field": {
"content": {
"like_text": ""escaped ? cat""
}
}
}
]
}
}}
--
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+unsubscribe@googlegroups.com .
For more options, visit https://groups.google.com/groups/opt_out .
--
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+unsubscribe@googlegroups.com .
For more options, visit https://groups.google.com/groups/opt_out .