Questions tagged [match-phrase]
69 questions
36
votes
2 answers
Multi-"match-phrase" query in Elastic Search
this should be obvious to me but is not. The following two-match only the second phase (in this case, Cape Basin)
"query": {
"match_phrase": {
"contents": {
"query": "St Peter Fm",
"query": "Cape Basin"
…

punkish
- 13,598
- 26
- 66
- 101
7
votes
1 answer
Elastic search match_phrase + fuzziness
I am using ElasticSearch and I am trying to implement match_phrase/string + fuzziness but it seems like it is impossible (not that much examples online, no such cases in the documentation).
What I need: phrase/string matching + fuzziness + slop…

BC1554
- 137
- 2
- 11
7
votes
1 answer
Elastic search query using match_phrase_prefix and fuzziness at the same time?
I am new to elastic search, so I am struggling a bit to find the optimal query for our data.
Imagine I want to match the following word "Handelsstandens Boldklub".
Currently, I'm using the following query:
{
query: {
bool: {
…

Henrik Holm
- 617
- 2
- 6
- 13
6
votes
3 answers
How to make exact phrase matching in elastic search?
I am trying to implement an exact match search in elastic search. But I am not getting the required results.
Here is the code to explain the issue I am facing and things I tried.
doc1 = {"sentence": "Today is a sunny day."}
doc2 = {"sentence": "…

Gaurav Chawla
- 1,473
- 3
- 14
- 19
4
votes
1 answer
Force Match phrase to discard results with full email searching only its domain
I'd like to find in my ElasticSearch index the string outlook.com inside a text with a match_phrase query. But I don't want results that are something...@outlook.com, that are taken with this query:
GET /my_index/_search
{
"size": 1,
"query": {
…

Paolo Magnani
- 549
- 4
- 14
4
votes
1 answer
Elasticsearch wildcard, regexp, match_phrase, prefix query returning wrong results
I have just started using Elasticsearch, version 7.5.1.
I want to query results which start with a particular word fragment.
For example tho* should return data containing:
thought, Thomson, those, etc.
I tried with…

Aditya
- 43
- 1
- 5
4
votes
1 answer
Match Phrase Prefix Query
I'm having an issue where elasticsearch is returning different results across my environments (staging and production).
The version of elasticsearch I'm using are the same for both environments.
version: { created: 1000199}
The two environments…

Roy Kachouh
- 1,855
- 16
- 24
3
votes
1 answer
How to aggregate on a matched prefix/phrase from ElasticSearch records?
I have a field "Departments" which is a list:
{
"Departments": ["Food Service","Software Development","Manufacturing","Deployment"]
}'
I want to aggregate on the elements of "Department" that start with "d". i.e., Deployment from all records.
I am…

Shruti Kar
- 147
- 1
- 12
3
votes
0 answers
Spacy | is it possible to remove the hardcoded limit on lengths in the phrasematcher?
I'm using Spacy library on python3.6, I have an array of 700 terms and a PharseMatcher that work with it.
It worked great when I had 10-12 terms but when I use a lot of terms it throws the error:
ValueError: [T001] Max length currently 10 for phrase…

Aviv
- 193
- 2
- 11
3
votes
0 answers
Elasticsarch: fuzziness in match_phrase
I need to make a full text query to match phrase with several words, with defined slop. But text may have misspellings, hence I need fuzziness as well.
I may use match_phrase with slop, then I lose fuzziness
I may use match with fuzziness with…

kokeksibir
- 1,725
- 2
- 18
- 30
3
votes
1 answer
ElasticSearch: alternative of using match_phrase to support fuzziness
My documents have a 'description' field, containing between 3 to 10 sentences.
I have to support fuzziness because I can't expect to the exact same words from the user.
On the other hand, I have to use the "match_phrase" rather than "match" because…

David
- 2,528
- 1
- 23
- 29
3
votes
0 answers
Phrase searching in an inverted index
I am implementing a very rudimentary inverted index, and I am having trouble implementing a phrase searching method.
I have the following structure:
InvertedIndex.java: here I have a data structure:
private Map> index =…

Anderology
- 147
- 1
- 2
- 9
3
votes
0 answers
Maintain sequence order for match phrase query with slop in Elasticsearch Java API
I am trying to do a query which should be similar to the phrase query except that there can be gaps within consecutive tokens. Example:
Document: "a b c d"
Search: "a c" >> This should return the document,
Search: "c a" >> This should not return the…

Zobayer Hasan
- 2,187
- 6
- 22
- 38
2
votes
1 answer
ElasticSearch exact match on text field with script
I'm trying to search with an ElasticSearch query documents that have exactly a certain value in a text field. I know that with a term query it could be possible if it were a keyword field. Unfortunately, I can't change the mapping.
{
"my_index":…

Paolo Magnani
- 549
- 4
- 14
2
votes
1 answer
elasticsearch match_phrase query for exact sub-string search
I used match_phrase query for search full-text matching.
But it did not work as I thought.
Query:
POST /_search
{
"query": {
"bool": {
"should": [
{
"match_phrase": {
"browsing_url": "/critical-illness"
…

Ankit
- 21
- 6