full-text-search

How to search for similar words

僤鯓⒐⒋嵵緔 提交于 2020-01-04 05:51:20
问题 I have a record file and I need to make a program that should help find any word into that record by typing a word into a search field. The record file contains a list of words so I need to search into that list to find any word that could be similar to my word. I am using Delphi 2007 回答1: Delphi 2007 should have a number of string matching routines in StrUtils that use the Soundex algorithm to find similar "sounding" words. Depending on how your file is formatted you may be able to load it

Solr Query on Unique Integer Field

大城市里の小女人 提交于 2020-01-04 05:13:16
问题 I have a field defined in schema.xml as: <field name="id" type="integer" indexed="true" stored="true" required="true" /> It is also the uniqueKey for the schema. I cannot perform a query on this field with the query url: /select?q=4525&qf=id&fl=id,name%2Cscore This returns no results, however, if I search on a different field(such as a text field), with a different query, I get many results, which include the stored id. Solr is working great for text fields, but I cannot query for items based

Apostrophes and SQL Server FT search

天涯浪子 提交于 2020-01-04 04:57:12
问题 I have setup FT search in SQL Server 2005 but I cant seem to find a way to match "Lias" keyword to a record with "Lia's". What I basically want is to allow people to search without the apostrophe. I have been on and off this problem for quite some time now so any help will really be a blessing. 回答1: EDIT 2: just realised this doesn't actually resolve your problem, please ignore and see other answer! The code below will return results for a case when a user has inserted an apostrophe which

Why sqlite fts5 Unicode61 Tokenizer does not support CJK(Chinese Japanese Korean)?

喜夏-厌秋 提交于 2020-01-04 01:20:33
问题 I had thought Unicode61 Tokenizer can support CJK -- Chinese Japanese Korean I verify my sqlite supports fts5 sqlite> pragma compile_options; BUG_COMPATIBLE_20160819 COMPILER=clang-9.0.0 DEFAULT_CACHE_SIZE=2000 DEFAULT_CKPTFULLFSYNC DEFAULT_JOURNAL_SIZE_LIMIT=32768 DEFAULT_PAGE_SIZE=4096 DEFAULT_SYNCHRONOUS=2 DEFAULT_WAL_SYNCHRONOUS=1 ENABLE_API_ARMOR ENABLE_COLUMN_METADATA ENABLE_DBSTAT_VTAB ENABLE_FTS3 ENABLE_FTS3_PARENTHESIS ENABLE_FTS3_TOKENIZER ENABLE_FTS4 ENABLE_FTS5 But to my surprise

Elasticsearch two level sort in aggregation list

余生长醉 提交于 2020-01-03 17:27:31
问题 Currently I am sorting aggregations by document score, so most relevant items come first in aggregation list like below: { 'aggs' : { 'guilds' : { 'terms' : { 'field' : 'guilds.title.original', 'order' : [{'max_score' : 'desc'}], 'aggs' : { 'max_score' : { 'script' : 'doc.score' } } } } } } I want to add another sort option to the order terms order array in my JSON. but when I do that like this : { 'order' : [{'max_score' : 'desc'}, {"_count" : "desc"}, } The second sort does not work. For

SQL Server 05, which is optimal, LIKE %<term>% or CONTAINS() for searching large column

那年仲夏 提交于 2020-01-03 17:05:42
问题 I've got a function written by another developer which I am trying to modify for a slightly different use. It is used by a SP to check if a certain phrase exists in a text document stored in the DB, and returns 1 if the value is found or 0 if its not. This is the query: SELECT @mres=1 from documents where id=@DocumentID and contains(text, @search_term) The document contains mostly XML, and the search_term is a GUID formatted as an nvarchar(40). This seems to run quite slowly to me (taking 5-6

MongoDB and fulltext search part of the word

旧城冷巷雨未停 提交于 2020-01-03 05:02:06
问题 I need to find a part of the word, if i search about len its shut find all the words there starting by len. i'm trying to use fulltext search in MongoDB and its working well when its hit 100% words and not just a part of the words. Have sombardy a soluion to me to get this issue to working? Sample code there working: db.getCollection('product').find({ '$and' : [{ '$text': { '$search' : 'lenovo', // match word '$caseSensitive' : false }, '$text': { '$search' : 'y50 b50 y700', // synonym

How to escape special characters in sphinxQL fulltext search?

假装没事ソ 提交于 2020-01-03 01:54:06
问题 in the sphinx changelog it says for 0.9.8: "added query escaping support to query language, and EscapeString() API call" can i assume, that there should be support for escaping special sphinx characters (@, !, -, ...) for sphinxQL, too? if so, maybe someone could point me to an example on this. i'm unable to find anything about it in the documentation or elsewhere on the net. how do you do fulltext search (using spinxQL), if the search-phrase contains one of the special characters? i don't

How do you extract all the tokens in a SQLite FTS table?

谁都会走 提交于 2020-01-02 23:15:25
问题 For debugging purposes I want to see all the tokens that exist in a Full Text Search virtual table in SQLite. When I look at the database structure for my FTS table (named fts_table ) I see the following: But browsing the data in these tables doesn't show the the list of tokens (not that I can find, anyway). How do I extract a simple list of tokens? 回答1: You can do this with ftx4aux, which gives direct access to the full text index. Use the following SQLite commands: CREATE VIRTUAL TABLE

Fulltext and composite indexes and how they affect the query

北战南征 提交于 2020-01-02 17:16:44
问题 Just say I had a query as below.. SELECT name,category,address,city,state FROM table WHERE MATCH(name,subcategory,category,tag1) AGAINST('education') AND city='Oakland' AND state='CA' LIMIT 0, 10; ..and I had a fulltext index as name,subcategory,category,tag1 and a composite index as city,state ; is this good enough for this query? Just wondering if something extra is needed when mixing additional AND 's when making use of the fulltext index with the MATCH/AGAINST. Edit: What I am trying to