Questions tagged [match-phrase]
69 questions
2
votes
1 answer
Elasticsearch: How to use operator - and/or for phrase queries?
Let's say I have the following query string that the user enters - "dark blue shoes and water washable"
Basically I want to search for both "dark blue shoes" and "water washable" in product_description OR product_title field.
And also the same goes…

kapso
- 11,703
- 16
- 58
- 76
2
votes
1 answer
Elasticsearch: combine match_phrase and match in order to get only results for match_phrase (if any)
I have an index of books where I store the full text content of books (with stopwords removed, but that's not important for my question).
I have the following query:
> GET /books/_search
> {
> "_source": {
> "includes":…

Diego Pascotto
- 329
- 2
- 13
2
votes
1 answer
How to solve Memory Error with Spacy PhraseMatcher?
Highlevel Background
I'm working on a project where in the first step I'm searching for keywords and phrases inside a large text corpus. I want to identify passages/sentences where these keywords occur. Later I want to make these passages accessible…

wiesbadener
- 41
- 5
2
votes
0 answers
Combining phrases from list of words Python3
doing my best to grab information out of a lot of pdf files. Have them in a dictionary format where the key is a given date and the values are a list of occupations.
looks like this when proper:
'12/29/2014': [['COUNSELING',
…

Sean
- 21
- 3
2
votes
1 answer
Peter Norvig's spell checker for multi-word matches
Peter Norvig's famous spellchecker (Java 8 version here) is able to correct single words, if something close to that word appears in training data. But how can I adapt it to handle entire phrases. For example, if I have a file where each phrase is…

Daud
- 7,429
- 18
- 68
- 115
2
votes
1 answer
How to generate multi-word search suggestions
I'm using Elasticsearch to build a small search app and am trying to figure out how to build an autocomplete feature with multi-word (phrase) suggestions. I have it working... sort of...
I get mostly single word suggestions, but when I hit the space…

user3125823
- 1,846
- 2
- 18
- 46
2
votes
1 answer
Match phrase query with multiple fields in elasticsearch using nest
I am trying to query using matchphrase but on multiple fields but my nest allows me to do it on only one field here's my code snippet
var result = client.Search(s => s
.Analyzer("automplete")
.Query(p => p
.MatchPhrase(M =>…

pavan sp
- 105
- 2
- 17
1
vote
1 answer
Extract paragraph surrounding phrase with spaCy from pandas column
I have a data frame with text data in one column. From this column, I would like to use spaCy to retrieve the sentences that surround a matchword.
Consider this toy data frame:
import pandas as pd
df_test: pd.DataFrame = pd.DataFrame(
{
…

Ivo
- 3,890
- 5
- 22
- 53
1
vote
0 answers
Elasticsearch: How to use "minimum_should_match" in match_phrase query?
I'm new to Elasticsearch. I'm trying to search keywords in Elasticsearch with the match_phrase.
And I don't want to match all terms, so I add the minimum_should_match in search queries, but it seems like it is impossible (ES doesn't support…

zo9n
- 11
- 1
1
vote
1 answer
ElasticSearch painless filter script on text fields not working
I want to use an equality filter (exact match) using a painless script in ElasticSearch. I cannot use directly a term query because the check I want to do is on a text field (and not keyword), so I tried with a match_phrase. This is my mapping: I…

Paolo Magnani
- 549
- 4
- 14
1
vote
1 answer
elastic match_phrase_prefix set order of words
Unable to find a clean way to do this type of query -- is there a way to specify that these prefixes return only results with the word prefixes in order? Such that a valid return would be Alpha Beta and Beta Alpha would not return?
"query":…

caro
- 863
- 3
- 15
- 36
1
vote
1 answer
Spacy Regex Phrase Matcher in Python
In a large corpus of text, I am interested in extracting every sentence which has a specific list of (Verb-Noun) or (Adjective-Noun) somewhere in the sentence. I have a long list but here is a sample. In my MWE I am trying to extract sentences with…

Amatya
- 1,203
- 6
- 32
- 52
1
vote
1 answer
Match_phrase is elastic search not working as expected
In my elastic search I have documents which contains a "fieldname" with values "abc" and "abc-def". When I am using match_phrase query for searching documents with fieldname "abc" it is returning me documents with values "abc-def" as well. However…

Sudhanshu Goyal
- 43
- 5
1
vote
2 answers
Elastic Search 1.4 phrase query with OR operator with hyphen (-) in search string
I have a issue in Elastic search 1.4 phrase query. I am creating a below index with the data.
curl -XPUT localhost:9200/test
curl -XPOST localhost:9200/test/doc/1 -d '{"field1" : "abc-xyz"}'
curl -XPOST localhost:9200/test/doc/2 -d '{"field1" :…

user2730259
- 73
- 8
1
vote
1 answer
Elasticsearch significant terms aggregation doc_count differs from hits when doing a match phrase search for the same term
I am using the significant terms aggregation, which gives me n significant terms with their doc_count and bg_count using the following query:
{
"query" : {
"terms" : {"user_id": ["x"]}
},
"aggregations" : {
"word_cloud" : {
…

Piyush Das
- 610
- 1
- 7
- 18