full-text-search

Automatic OR queries using SQLite FTS4

三世轮回 提交于 2019-12-11 03:33:22
问题 I have a SQLite FTS4 database, and I would like to be able to perform OR queries on it from user-input, e.g. if the user enters "hello there" I would like to do SELECT * FROM fts_table WHERE text MATCHES 'hello OR there'. However, if I pass simply pass in the user-string I get an implicit AND query instead. I could of course tokenize the string myself, and insert ORs, but then I'm using my own tokenizer which could differ from the tokenizer being used internally by SQLite's FTS. Is there some

Python: Whoosh seems to return incorrect results

我的梦境 提交于 2019-12-11 03:22:51
问题 This code is straight from Whoosh's quickstart docs: import os.path from whoosh.index import create_in from whoosh.fields import Schema, STORED, ID, KEYWORD, TEXT from whoosh.index import open_dir from whoosh.query import * from whoosh.qparser import QueryParser #establish schema to be used in the index schema = Schema(title=TEXT(stored=True), content=TEXT, path=ID(stored=True), tags=KEYWORD, icon=STORED) #create index directory if not os.path.exists("index"): os.mkdir("index") #create the

MySQL Full Text Search Not Matching

久未见 提交于 2019-12-11 03:19:15
问题 My MySQL table is not returning results with a MATCH (col) AGAINST ('') query. The table is simple: id | url | fullTextIndex And my query is SELECT *, Match(fullTextIndex) AGAINST ("7f7f7f807f8080807f8080807f7f7f807c828888808a86967e8b858d7f89838a76829e958f7badb68084a3a38384899077848b877f799f9c85799fa2827d8c8a ") FROM Pictures; The last column, the match, is always 0. Except, I know for a fact that the string above is contained, verbatim, in one of the values. Things to note: The string is

Django - fulltext search with PostgreSQL and Elasticsearch

谁说胖子不能爱 提交于 2019-12-11 02:58:25
问题 I have a Django and Django REST Framework powered RESTful API (talking to a PostgreSQL DB backend) which supports filtering on a specific model. Now I want to add a fulltext search functionality. Is it be possible to use Elasticsearch for fulltext search and then apply my existing API filters on top of these search results? 回答1: I would suggest you consider using PostgreSQL only to do what you asked for. In my opinion it is the best solution because you will have the data and the search

How does ReversedWildcardFilterFactory speed up wildcard searches?

☆樱花仙子☆ 提交于 2019-12-11 02:55:27
问题 The Solr docs say: solr.ReversedWildcardFilterFactory A filter that reverses tokens to provide faster leading wildcard and prefix queries. Add this filter to the index analyzer, but not the query analyzer. The standard Solr query parser will use this to reverse wildcard and prefix queries to improve performance... How does it do that though? Since all the tokens run through the ReversedWildcardFilterFactory, does it store all the tokens in reverse? (That seems silly to me) Or, does it store

MySQL Full Text Search with utf8 (Persian/Arabic)

社会主义新天地 提交于 2019-12-11 02:24:23
问题 I have problem with full text search just on UTF8/Unicode Persian/Arabic Language (nothing found from querys). Tables are set with utf8/utf8_persian_ci on encoding. Using mysql_query("SET NAMES 'UTF8'"); for Unicode Querys. English strings work fine. Below is My search codes: <?php mysql_connect("localhost", "user", "password"); mysql_select_db("search"); mysql_query("SET NAMES 'UTF8'"); $q = $_GET['q']; ?> <form action="<?php $_SERVER['PHP_SELF']; ?>"> <input type="text" name="q" value="<

Sql Server 2008 - FullText rounding money values?

若如初见. 提交于 2019-12-11 02:16:10
问题 Lets assume we have a full text indexed table with those records: blabla bla bla 101010,65 blabla bla bla blabla bla bla 1012344,34 blabla bla bla (The decimal separator in Portuguese is "," not "." as in English) When we execute a query like: where contains(field, "101011") or where contains(field, "1012344") The full text engine is returning those records because it seems to me that it is rounding the numbers as: 101010,65 becomes 101011 1012344,34 becomes 1012344 Is there any way of

MySQL “OR MATCH” hangs (very slow) on multiple tables

南笙酒味 提交于 2019-12-11 02:14:45
问题 After learning how to do MySQL Full-Text search, the recommended solution for multiple tables was OR MATCH and then do the other database call. You can see that in my query below. When I do this, it just gets stuck in a "busy" state, and I can't access the MySQL database. SELECT a.`product_id`, a.`name`, a.`slug`, a.`description`, b.`list_price`, b.`price`, c.`image`, c.`swatch`, e.`name` AS industry, MATCH( a.`name`, a.`sku`, a.`description` ) AGAINST ( '%s' IN BOOLEAN MODE ) AS relevance

How to add synonym dictionary to mysql FULLTEXT search?

人盡茶涼 提交于 2019-12-11 01:16:15
问题 That way if I search for the term "mens" the term "gentlemen" will match. I tried this: SELECT * FROM cart_product WHERE MATCH ( product_name, product_description, product_brand, metal_type, primary_stone, product_type, product_type_sub, product_series, primary_stone_sub ) AGAINST ( 'THESAURUS "english" EXPAND SYNONYM TERM OF "gentlemen"' ) But that doesn't seem to work. Is this wrong? is there somethig else I have to do with this? 来源: https://stackoverflow.com/questions/3265396/how-to-add

SQL Server Contains Full Text Function Not Returning Expected Results

我的未来我决定 提交于 2019-12-10 23:55:12
问题 I can't quite figure out why I am getting unexpected results from the following query/statement. I have included code to replicate the issue (which may not be an issue at all but more a misunderstanding on my part about how contains works). create table dbo.temp (id int identity, description nvarchar(max)) insert dbo.temp values ('this is a website.') --this record will be returned in the select query insert dbo.temp values ('a website exists.') --this record will be returned in the select