full-text-search

MongoDB Can't canonicalize query: BadValue Too many text expressions

坚强是说给别人听的谎言 提交于 2021-02-19 05:20:26
问题 I am attempting to build a query for MongoDB in Java and I am running into this error, "Can't canonicalize query: BadValue Too many text expressions" whenever I run the query. The database is full of documents with a text property that is indexed for full text searching. I am trying to build a query to find any documents that match one or more of the queries in queryList and are within a certain time range. It works fine if there is only one query in the queryList, but fails otherwise. Any

How to enable/install Full Text Search in SQL Server 2014

十年热恋 提交于 2021-02-17 03:22:29
问题 There is probably a very simple answer to the question but I have no idea how I'm going to enable Full Text Search in SQL Server 2014. I've been searching the net for the last couple of hours, some posts about SQL Server 2012 said it's in the features during installation but I went there and I had no options to enabled it. It is definitely not enabled or installed since I ran select SERVERPROPERTY('IsFullTextInstall') and got a 0. To expand on this more, i've created a Full Text Catalog but

How to enable/install Full Text Search in SQL Server 2014

佐手、 提交于 2021-02-17 03:21:29
问题 There is probably a very simple answer to the question but I have no idea how I'm going to enable Full Text Search in SQL Server 2014. I've been searching the net for the last couple of hours, some posts about SQL Server 2012 said it's in the features during installation but I went there and I had no options to enabled it. It is definitely not enabled or installed since I ran select SERVERPROPERTY('IsFullTextInstall') and got a 0. To expand on this more, i've created a Full Text Catalog but

sql injection in sqlite full text search

偶尔善良 提交于 2021-02-16 20:46:11
问题 consider sqlite3 fts4 table c.execute("CREATE VIRTUAL TABLE docs USING fts4(content)") Is the following safe from sql injection where txt contains a string? I am not sure if parameterised query is safe or not,since there is only one parameter txt which is a string. c.execute("SELECT * FROM docs WHERE docs MATCH (?)",(txt,)) 回答1: Yes, it is safe from SQL injection; that is what the SQL parameter is for , to escape and quote txt properly. If you were to use string formatting ( "... MATCH ('%s')

How to use SQLAlchemy to create a full text search index on SQLite and query it?

我是研究僧i 提交于 2021-02-16 13:40:26
问题 I am create a simple app which can performance basic operations. SQLite is used as database. I want to perform wildcard search but I know that it has poor performance. I want to try out full text search but I cannot full a example on how to do it. I confirmed that SQLite has full text search support. Here is my sample code. from flask_sqlalchemy import SQLAlchemy db = SQLAlchemy() class Person(db.Model): id = db.Column(db.Integer, primary_key=True) name = db.Column(db.Text, unique=True,

How to use SQLAlchemy to create a full text search index on SQLite and query it?

被刻印的时光 ゝ 提交于 2021-02-16 13:40:09
问题 I am create a simple app which can performance basic operations. SQLite is used as database. I want to perform wildcard search but I know that it has poor performance. I want to try out full text search but I cannot full a example on how to do it. I confirmed that SQLite has full text search support. Here is my sample code. from flask_sqlalchemy import SQLAlchemy db = SQLAlchemy() class Person(db.Model): id = db.Column(db.Integer, primary_key=True) name = db.Column(db.Text, unique=True,

Full Text Search always returns empty result set

心不动则不痛 提交于 2021-02-08 08:28:19
问题 I have a table named 'fact' with title column, that should be full text index. Firstly, I add a full text index: ALTER TABLE fact ADD FULLTEXT title_fts (title) So, I insert row: INSERT INTO fact (id, title) VALUES ('1', 'red blue yellow ok green grey ten first wise form'); And then I perform search: select * from fact f where contains (f.title, '"red" or "blue"') When I perform the following query, or any other query with 'contains' statement, I get emtpy result set: I have to use this

Full Text Search always returns empty result set

守給你的承諾、 提交于 2021-02-08 08:27:49
问题 I have a table named 'fact' with title column, that should be full text index. Firstly, I add a full text index: ALTER TABLE fact ADD FULLTEXT title_fts (title) So, I insert row: INSERT INTO fact (id, title) VALUES ('1', 'red blue yellow ok green grey ten first wise form'); And then I perform search: select * from fact f where contains (f.title, '"red" or "blue"') When I perform the following query, or any other query with 'contains' statement, I get emtpy result set: I have to use this

Python - Fast count words in text from list of strings and that start with

和自甴很熟 提交于 2021-02-08 02:40:30
问题 I know that similar questions have been asked several times, but my problem is a bit different and I am looking for a time-efficient solution, in Python. I have a set of words, some of them end with the "*" and some others don't: words = set(["apple", "cat*", "dog"]) I have to count their total occurrences in a text, considering that anything can go after an asterisk ("cat*" means all the words that start with "cat"). Search has to be case insensitive. Consider this example: text = "My cat

Python - Fast count words in text from list of strings and that start with

南笙酒味 提交于 2021-02-08 02:40:14
问题 I know that similar questions have been asked several times, but my problem is a bit different and I am looking for a time-efficient solution, in Python. I have a set of words, some of them end with the "*" and some others don't: words = set(["apple", "cat*", "dog"]) I have to count their total occurrences in a text, considering that anything can go after an asterisk ("cat*" means all the words that start with "cat"). Search has to be case insensitive. Consider this example: text = "My cat