full-text-search

How do I add the condition “IS NOT NULL” to a Thinking Sphinx search

谁都会走 提交于 2019-12-21 04:22:14
问题 I'm using Thinking Sphinx for full-text search, following this video. I'd like to do the following: @articles = Article.search(params[:search], :conditions => "published_at IS NOT NULL", :order => :created_at) The problem is that this doesn't work. It seems that the search method only accepts conditions that are a hash. I've tried a couple of ways, but I am clueless as to how I can represent "published_at IS NOT NULL" as a hash... 回答1: Was given the solution over at Railscasts If you want

How do I add the condition “IS NOT NULL” to a Thinking Sphinx search

不羁岁月 提交于 2019-12-21 04:22:03
问题 I'm using Thinking Sphinx for full-text search, following this video. I'd like to do the following: @articles = Article.search(params[:search], :conditions => "published_at IS NOT NULL", :order => :created_at) The problem is that this doesn't work. It seems that the search method only accepts conditions that are a hash. I've tried a couple of ways, but I am clueless as to how I can represent "published_at IS NOT NULL" as a hash... 回答1: Was given the solution over at Railscasts If you want

MySQL error: “Column 'columnname' cannot be part of FULLTEXT index”

自古美人都是妖i 提交于 2019-12-21 03:55:17
问题 Recently I changed a bunch of columns to utf8_general_ci (the default UTF-8 collation) but when attempting to change a particular column, I received the MySQL error: Column 'node_content' cannot be part of FULLTEXT index In looking through docs, it appears that MySQL has a problem with FULLTEXT indexes on some multi-byte charsets such as UCS-2, but that it should work on UTF-8. I'm on the latest stable MySQL 5.0.x release (5.0.77 I believe). 回答1: Oops, so I have found the answer to my problem

Use the Datastore (NDB), the Search API or both for views on data?

霸气de小男生 提交于 2019-12-21 02:14:12
问题 In a CMS, a list of customers is retrieved using a regular NDB query with ordering. To allow filtering on name, company name and email, I create several (sometimes many) indices. The situation was not ideal, but workable. Now there's the (experimental) Search API. It seems to have no relation to the datastore (or NDB), but my data is already there. I'd like to use Full Text Search and put filters on multiple fields simultaniously, so should I keep my data in the Datastore and duplicate parts

remove stop words without stemming in postgresql

*爱你&永不变心* 提交于 2019-12-21 01:59:25
问题 I want to remove the stop words from my data but I do not want to stem the words since the exact words matters to me. I used this query. SELECT to_tsvector('english',colName)from tblName order by lower asc; Is there any way that I can remove stopWords without stemming the words? thanks 回答1: Create your own text search dictionary and configuration: CREATE TEXT SEARCH DICTIONARY simple_english (TEMPLATE = pg_catalog.simple, STOPWORDS = english); CREATE TEXT SEARCH CONFIGURATION simple_english

How to create text index for '%abc%' search?

五迷三道 提交于 2019-12-21 01:59:05
问题 I'd like to index queries like x like '%abc%' If I have a table like the following create table t ( data varchar(100) ); I want to create an index to be able to do the following efficiently: select * from t where contains('%abc%'); And this: select * from t where contains('abc%'); I also want this table to be updated live. How do I create such an index? (I have a feeling I need a ctxcat index, but I'm confused about what options I need to give it) I'm using Oracle 10g. 回答1: I would use this

Faster way of searching a string in text files [closed]

别说谁变了你拦得住时间么 提交于 2019-12-20 19:44:16
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago . I need to search for a string, roughly 13 characters, in a group of text files using C#. The number of text files is changing and can range between 100-1000. The size of the files can range between 1KB and 10MB. I tried the naive way of opening each file, read it line by line and

MySQL fulltext search with @ symbol produces error “syntax error, unexpected '@', expecting $end”

三世轮回 提交于 2019-12-20 18:27:12
问题 The following query results in an error due to the @ (at symbol). The query will work fine when it is removed. I tried escaping the @ character, but no luck. SELECT * FROM clients WHERE MATCH (form) AGAINST ('test@test.com' IN BOOLEAN MODE); The error produced is: #1064 - syntax error, unexpected '@', expecting $end Note that I am testing these queries in the phpMyAdmin SQL console area, so it's not a matter of an escape error with my other programming. MySQL server is version 5.6.17. Any

MySQL 5.6 InnoDB Full Text Search

拈花ヽ惹草 提交于 2019-12-20 14:14:34
问题 I realize that MySQL 5.6 is still in beta, but does anyone have experience using the new InnoDB FTS engine? How does it compare to something like Sphinx? Thanks Jason 回答1: Never used Sphinx, but tried MySQL 5.6 FTS on an Innodb table with about 170k rows. Made an FTS index on the name column (contains all names of a person). To find a word in any position of the string MATCH(name) AGAINST("+word*") IN BOOLEAN MODE does work a lot faster (2-3 times in my case) than using name LIKE "word%" OR

Writing an Inverted Index in C# for an information retrieval application

て烟熏妆下的殇ゞ 提交于 2019-12-20 10:45:02
问题 I am writing an in-house application that holds several pieces of text information as well as a number of pieces of data about these pieces of text. These pieces of data will be held within a database (SQL Server, although this could change) in order of entry. I'd like to be able to search for the most relevant of these pieces of information, with the most relevant of these to be at the top. I originally looked into using SQL Server Full-Text Search but it's not as flexible for my other needs