Changes
Page history
Update Suggestions ("Did you mean" feature!)
authored
Jun 25, 2022
by
Fruth, Leon
Show whitespace changes
Inline
Side-by-side
Suggestions-("Did-you-mean"-feature!).md
View page @
9e3850ea
...
...
@@ -5,6 +5,8 @@
-
Phrase suggester: Suggests corrections for phrases.
## Phrase suggester
Works overall better than Term suggester: "In practice this suggester will be able to make better decisions about which tokens to pick based on co-occurrence and frequencies."
1.
Works with phrases:
Query:
...
...
@@ -77,7 +79,10 @@ Results:
### How does it work
### Settings and Arguments
### Settings and Parameters
[
Parameters Documentation
](
https://www.elastic.co/guide/en/elasticsearch/reference/current/search-suggesters.html#_basic_phrase_suggest_api_parameters
)
-
*max_errors*
: sets how many terms in a phrase are corrected. Default value set to 1. In these tests I set the value to 2!
-
*analyzer*
: TODO: How does this work?
## Building a "Did you mean"-Feature
...
...
@@ -94,16 +99,17 @@ Results:
2.
Aggregated results: [{'text': 'python', 'score': 0.061882425}, {'text': 'pyhton', 'score': 0.020105202}]
3.
**Did you mean: "python"**
#### Search string: **"dat
a
midning"**
#### Search string: **"dat
s
midning"**
1.
Suggestions
-
Title Field: [{'text': 'data mining', 'score': 0.01
2581152
}]
-
Body Field: [{'text': 'data mining', 'score': 0.00
2154175
}, {'text': 'data missing', 'score': 0.001
2882735
}, {'text': 'da
ta man
ning', 'score': 0.00
10319541
}, {'text': 'data m
e
aning', 'score': 0.00
10319541
}]
2.
Aggregated results: [{'text': 'data mining', 'score': 0.01
4735327
}, {'text': 'data missing', 'score': 0.001
2882735
}, {'text': 'da
ta man
ning', 'score': 0.00
10319541
}, {'text': 'data m
e
aning', 'score': 0.00
10319541
}]
-
Title Field: [{'text': 'data mining', 'score': 0.01
135363}, {'text': 'does mining', 'score': 0.011018485
}]
-
Body Field: [{'text': 'data mining', 'score': 0.00
19439956
}, {'text': 'data missing', 'score': 0.001
1625788
}, {'text': 'da
s minding', 'score': 0.0011426819}, {'text': 'das mi
ning', 'score': 0.00
094476255
}, {'text': 'data ma
n
ning', 'score': 0.00
093126803
}]
2.
Aggregated results: [{'text': 'data mining', 'score': 0.01
32976256}, {'text': 'does mining', 'score': 0.011018485
}, {'text': 'data missing', 'score': 0.001
1625788
}, {'text': 'da
s minding', 'score': 0.0011426819}, {'text': 'das mi
ning', 'score': 0.00
094476255
}, {'text': 'data man
n
ing', 'score': 0.00
093126803
}]
3.
**Did you mean: "data mining"**
#### Search string: **"data midning"**
1.
Suggestions
-
Title Field: [{'text': 'data mining', 'score': 0.012581152}]
-
Body Field: [{'text': 'data mining', 'score': 0.002154175}, {'text': 'data missing', 'score': 0.0012882735}, {'text': 'data manning', 'score': 0.0010319541}, {'text': 'data meaning', 'score': 0.0010319541}]
2.
Aggregated results: [{'text': 'data mining', 'score': 0.014735327}, {'text': 'data missing', 'score': 0.0012882735}, {'text': 'data manning', 'score': 0.0010319541}, {'text': 'data meaning', 'score': 0.0010319541}]
#### Search string: **"pthun progrmaing tutorial"**
1.
Suggestions
-
Title Field: []
-
Body Field: [{'text': 'python programming tutorial', 'score': 0.00014904435}, {'text': 'python progrmaing tutorial', 'score': 2.8872057e-05}, {'text': 'pthun programming tutorial', 'score': 2.1344658e-05}]
2.
Aggregated results: [{'text': 'python programming tutorial', 'score': 0.00014904435}, {'text': 'python progrmaing tutorial', 'score': 2.8872057e-05}, {'text': 'pthun programming tutorial', 'score': 2.1344658e-05}]
3.
**Did you mean: "python programming tutorial"**