[英]Count number of times a phrase is near another phrase, within n# of words of each other
我需要計算在 dataframe 字符串的每一行中,特定短語在另一個特定短語的 3 個單詞內出現的次數。 順序無關緊要。 為了說明:X =“黑貓”,Y =“是我的”,接近距離 = 3,並且字符串 =“黑貓是我的黑貓”,...... output 計數將是兩個(找到兩個獨特的對). “ window ...
[英]Count number of times a phrase is near another phrase, within n# of words of each other
我需要計算在 dataframe 字符串的每一行中,特定短語在另一個特定短語的 3 個單詞內出現的次數。 順序無關緊要。 為了說明:X =“黑貓”,Y =“是我的”,接近距離 = 3,並且字符串 =“黑貓是我的黑貓”,...... output 計數將是兩個(找到兩個獨特的對). “ window ...
[英]Extract paragraph surrounding phrase with spaCy from pandas column
我有一個數據框,其中一列包含文本數據。 在本專欄中,我想使用 spaCy 檢索匹配詞周圍的句子。 考慮這個玩具數據框: 這個短語匹配器包含兩個模式matchw1和matchw2 :import spacy nlp = spacy.load("en_core_web_sm") phrase_matc ...
[英]ElasticSearch painless filter script on text fields not working
我想在 ElasticSearch 中使用無痛腳本使用相等過濾器(完全匹配) 。 我不能直接使用term查詢,因為我想做的檢查是在text字段(而不是keyword )上,所以我嘗試了match_phrase 。 這是我的映射:我無法更改它。{ "my_index": { "aliase ...
[英]ElasticSearch exact match on text field with script
我正在嘗試使用在text字段中具有特定值的 ElasticSearch 查詢文檔進行搜索。 我知道如果它是keyword字段,則使用術語查詢是可能的。 不幸的是,我無法更改映射。{ "my_index": { "aliases": {}, "mappings": { ...
[英]Elatisearch match_phrase_prefix query, with exact prefix match
我有一個 match_phrase_prefix 查詢,它按預期工作。 但是當用戶在關鍵字末尾傳遞任何特殊字符時,ES 忽略這些字符,仍然返回結果。 query{ match_phrase_prefix:{ content: { query: searchTerm } } } 我正在使用此查詢來搜索 ...
[英]elastic match_phrase_prefix set order of words
無法找到一種干凈的方法來執行這種類型的查詢——有沒有辦法指定這些前綴只返回帶有單詞前綴的結果? 這樣一個有效的回報將是 Alpha Beta 而 Beta Alpha 不會返回? }, ...
[英]Spacy Regex Phrase Matcher in Python
在大量文本語料庫中,我有興趣提取句子中某處具有(動詞-名詞)或(形容詞-名詞)特定列表的每個句子。 我有一個很長的清單,但這里有一個示例。 在我的 MWE 中,我試圖用“write/wrote/writing/writes”和“book/s”提取句子。 我有大約 30 對這樣的詞。 這是我嘗試過的, ...
[英]Elasticsearch wildcard, regexp, match_phrase, prefix query returning wrong results
我剛剛開始使用 Elasticsearch,版本 7.5.1。 我想查詢以特定單詞片段開頭的結果。 例如tho * 應該返回包含以下內容的數據: 思想,湯姆森,那些,等等。 我試過 - 正則表達式 通配符 字首 匹配短語 所有這些都返回正確的結果,但它們也都返回單詞method 。 同樣cat * ...
[英]Match_phrase is elastic search not working as expected
在我的彈性搜索中,我的文檔包含一個“字段名”,其值為“abc”和“abc-def”。 當我使用 match_phrase 查詢搜索字段名為“abc”的文檔時,它也會返回值為“abc-def”的文檔。 但是,當我查詢“abc-def”時,它工作正常。 我的查詢如下: 有人可以幫我理解這個問題嗎? ...
[英]ElasticSearch: Not giving match
我想執行完全單詞匹配和部分單詞/子字符串匹配。 例如,如果我搜索“測試產品”,那么我應該能夠在結果中找到“測試”和“產品”相關的文本。 我正在使用以下匹配查詢搜索彈性搜索,這並沒有給我完全匹配,而是它也給出了一些更不重要的匹配。例如,它在結果中給出了“樣本”相關的文本。 我正在使用彈性搜索 6.3 ...
[英]Query string in elastic search
我正在使用以下匹配查詢搜索彈性搜索,這並沒有給我完全匹配,而是給出了一些更不重要的匹配。 我正在使用彈性搜索 6.3 請在下面找到我的查詢 搜索結果: “命中”:[{“_index”:“67107104”,“_type”:“_doc”,“_id”:“1”,“_score”:0.6931471,“_ ...
[英]How to turn off autocomplete for easticsearch match_phrase or match_phrase_prefix?
我有 ES 數據,其中包含text類型的字段name 。 我必須通過小寫輸入進行搜索,而實際名稱可能使用大小寫符號。 我只需要確切的(但不區分大小寫)名稱。 我嘗試使用match_phrase (以及match_phrase_prefix )。 但它會返回自動完成的結果。 喜歡查詢 返回兩項: 和 ...
[英]Elastic Search 1.4 phrase query with OR operator with hyphen (-) in search string
我在 Elastic search 1.4 短語查詢中遇到問題。 我正在使用數據創建以下索引。 curl -XPUT localhost:9200/test curl -XPOST localhost:9200/test/doc/1 -d '{"field1": "abc-xyz"}' cur ...
[英]Elasticsearch significant terms aggregation doc_count differs from hits when doing a match phrase search for the same term
我正在使用重要術語聚合,它使用以下查詢為我提供了 n 重要術語及其 doc_count 和 bg_count: 如果我采用重要術語聚合返回的術語並對該術語進行匹配短語查詢。 然后,我得到的 hits 值與聚合中的 doc_count 不同。 匹配詞組查詢: 字段preprocess_data.res ...
[英]Elasticsearch exact phrase match on JSON
我正在使用 elasticsearch 從 json 字段進行精確的短語匹配。 我已經嘗試過multi_match 、 query_string和simple_query_string等多種語法,但它們並沒有完全按照給定的短語返回結果。 我正在使用的query_string語法; 我也嘗試了過濾器而 ...
[英]ElasticSearch - Phrase match on whole document? Not just one specific field
有沒有辦法可以在整個文檔上使用彈性 match_phrase? 不僅僅是一個特定的領域。 我們希望用戶能夠輸入帶引號的搜索詞,並在文檔中的任何位置進行短語匹配。 目前,我只找到了特定領域的短語匹配。 我必須指定字段以在其中進行短語匹配。 我們的文檔有數百個字段,所以我認為在每個 match_ ...
[英]Elasticsearch 6.8 match_phrase search N-gram tokenizer works not well
我使用 Elasticsearch N-gram tokenizer並使用match_phrase模糊匹配我的索引和測試數據,如下所示: 檢查_分析: _分析結果: 當我搜索“rm”時,什么也沒找到: 但是可以找到“.rf”: 我的問題:為什么即使 _analyze 已經拆分 ...
[英]elasticsearch match_phrase query for exact sub-string search
我使用 match_phrase 查詢進行搜索全文匹配。 但它並沒有像我想象的那樣工作。 詢問: 結果: 期待: 映射: 結果不是我所期望的。 我希望得到的結果與搜索/critical-illness作為存儲文本的 substring 完全相同。 ...
[英]How to takes word order into account but does not require all searched words to exist in document for ElasticSearch match_phrase query?
假設我的索引有兩個文檔: “拿我的錢” “我的錢到了” 當我對“get my money”進行常規匹配查詢時,兩個文檔都正確匹配,但得分相同。 但是,我希望在評分過程中單詞的順序很重要。 換句話說,我希望“得到我的錢”有更高的分數。 因此,我嘗試將匹配查詢放在 bool 查詢的 must 子句 ...
[英]how to use multiple match phrases in must with or condition in elastic search?
如何在彈性搜索中使用必須或條件中的多個匹配短語? 嘗試了這個查詢....我需要在標簽中單詞完全匹配或在正文或標題或 answer.body 上部分匹配的結果但它不起作用。 添加評論獲取 questiondetails_new/question/_search? {“查詢”:{“布爾”:{“應該” ...