full-text-search

How to get a list of all tokens from Lucene 8.6.1 index using PyLucene?

こ雲淡風輕ζ 提交于 2021-01-05 08:53:15
问题 I have got some direction from this question. I first make the index like below. import lucene from org.apache.lucene.analysis.standard import StandardAnalyzer from org.apache.lucene.index import IndexWriterConfig, IndexWriter, DirectoryReader from org.apache.lucene.store import SimpleFSDirectory from java.nio.file import Paths from org.apache.lucene.document import Document, Field, TextField from org.apache.lucene.util import BytesRefIterator index_path = "./index" lucene.initVM() analyzer =

Poor Performance when trigram similarity and full-text-search were combined with Q ind django using postgres

落爺英雄遲暮 提交于 2021-01-04 07:50:31
问题 I'm creating a web application to search people with their properties such as education, experience, etc. I can't use full-text-search for all the fields, because, some has to be a fuzzy match. (Eg: if we search for biotech, it should pick bio tech, biotech and also bio-tech). My database has about 200 entries in the profile model, which is to appear in the search results. Other models like education and experience are connected to profile through foreign key Therefore, I decided to be

Returning ranked search results using gin index with sqlalchemy

旧街凉风 提交于 2020-12-30 11:54:35
问题 I have a GIN index set up for full text search. I would like to get a list of records that match a search query, ordered by rank (how well the record matched the search query). For the result, I only need the record and its columns, I do not need the actual rank value that was used for ordering. I have the following query, which runs fine and returns the expected results from my postgresql db. SELECT *, ts_rank('{0.1,0.1,0.1,0.1}', users.textsearchable_index_col, to_tsquery('smit:* | ji:*'))

How does `#:~:text=` in URL works to highlight text?

白昼怎懂夜的黑 提交于 2020-12-30 01:33:45
问题 TL;DR How/why are some browsers able to search and highlight text in the HTML body which is followed by #:~:text= in the URL? Explanation One day I was searching for something on Google, which lead me to Quora's result. I observed that 2 sentences were highlighted in yellow, which were part of URL after the aforementioned parameter. I thought this would be Quora's feature for SEO or something, however, also found this on Linkedin, and Medium, and so on. I'd like to know: What is this

ElasticSearch - cross_fields multi match with fuzzy search

二次信任 提交于 2020-12-27 17:04:25
问题 I have documents that represent users. They have fields name and surname . Let's say I have two users indexed - Michael Jackson and Michael Starr. I want these sample searches to work: Michael => { Michael Jackson , Michael Starr } Jack Mich => { Michael Jackson } (incomplete words and reversed order) Michal Star => { Michael Starr } (fuzzy search) I tried different queries and got the best results from multi_match query with cross_fields type. There are 2 problems though: It only finds

ElasticSearch - cross_fields multi match with fuzzy search

混江龙づ霸主 提交于 2020-12-27 17:04:12
问题 I have documents that represent users. They have fields name and surname . Let's say I have two users indexed - Michael Jackson and Michael Starr. I want these sample searches to work: Michael => { Michael Jackson , Michael Starr } Jack Mich => { Michael Jackson } (incomplete words and reversed order) Michal Star => { Michael Starr } (fuzzy search) I tried different queries and got the best results from multi_match query with cross_fields type. There are 2 problems though: It only finds

SQL Server Full Text Search not working for me

痴心易碎 提交于 2020-12-13 04:21:09
问题 I have problem with Full Text Search in SQL Server. My query: Select [Name] From [POI] Where Contains([Name], N'"bank of*"'); Query returns no rows. But table has several rows that contains "bank of ..." When I delete the word "of" everything works. Please help to solve this problem. 回答1: As described in this other question Dropping noise words in SQL Server 2005 full text indexing, noise words are not included in the indexing. "of" is a noise word, which would explain the behavior you're

FTS sqlite phrase search for single column not possible

一个人想着一个人 提交于 2020-12-06 04:21:08
问题 i've been using the FTS extension of sqlite, and can't seem to figure out how to do a phrase search for one column while matching some other text for some other. Usually doing a phrase search works for ALL columns like: SELECT * from ftstable where ftstable MATCH '"Phrase With Spaces In It"'; and for a specific column with: SELECT * from ftstable where body MATCH '"Phrase With Spaces In It"'; but doesn't work for a aggregated search in two columns like: SELECT * from ftstable where ftstable