full-text-search

PG full text search on rails using pg_search gem for substring

不问归期 提交于 2019-12-19 03:56:50
问题 I am using Pg full text search for my search . As i am using Ruby on rails, I am using pg_search gem. How do i configure it to give a hit for substring as well. pg_search_scope :search_by_detail, :against => [ [:first_name,'A'], [:last_name,'B'], [:email,'C'] ], :using => { :tsearch => {:prefix => true} } Right now it gives a hit if the substring is in the start but it wont give a hit if the substring in the middle example It gives a hit for sdate@example.com but not for example.com 回答1: I'm

How to delete or reset a search index in Appengine

前提是你 提交于 2019-12-19 03:37:08
问题 The Situation Alright, so we have our app in appengine with full text search activated. We had an index set on a document with a field named 'date'. This field is a DateField and now we changed the model of the document so the field 'date' is now a NumericField. The problem is, on the production server, even if I cleared all the document from the index, the server responds with this type of error: Failed to parse search request ""; SortSpec numeric default value does not match expression type

How to delete or reset a search index in Appengine

孤者浪人 提交于 2019-12-19 03:37:03
问题 The Situation Alright, so we have our app in appengine with full text search activated. We had an index set on a document with a field named 'date'. This field is a DateField and now we changed the model of the document so the field 'date' is now a NumericField. The problem is, on the production server, even if I cleared all the document from the index, the server responds with this type of error: Failed to parse search request ""; SortSpec numeric default value does not match expression type

Search ElasticSearch field contained in a value

南楼画角 提交于 2019-12-19 03:25:13
问题 I'm trying to run similar field query in ElasticSearch: select * from products where 'milk' like '%'+name+'%' Meaning I'm trying to find all the documents that the product name in this case is a sub string of 'milk'. How can I do it? 回答1: I would go with a custom analyzer leveraging ngrams. First create an index like this: curl -XPUT 'localhost:9200/tests' -d ' { "settings" : { "analysis" : { "analyzer" : { "my_analyzer" : { "tokenizer" : "ngrams" } }, "tokenizer" : { "ngrams" : { "type" :

LinqToSql and full text search - can it be done?

不羁岁月 提交于 2019-12-19 03:22:50
问题 Has anyone come up with a good way of performing full text searches ( FREETEXT() CONTAINS() ) for any number of arbitrary keywords using standard LinqToSql query syntax? I'd obviously like to avoid having to use a Stored Proc or have to generate a Dynamic SQL calls. Obviously I could just pump the search string in on a parameter to a SPROC that uses FREETEXT() or CONTAINS(), but I was hoping to be more creative with the search and build up queries like: "pepperoni pizza" and burger, not

set new value for “ft_min_word_len ” FULLTEXT in mysql

余生颓废 提交于 2019-12-18 19:23:23
问题 I changed to "ft_min_word_len" = 4 by my-innodb-heavy-4G.ini located in my system path "C:\Program Files\MySQL\MySQL Server 5.1" , but when i run SHOW VARIABLES LIKE 'ft_min_word_len' I got still result value= 4 . I did not find this variable in my.ini file. So i have also create a my logic. I copied to ft_min_word_len variable and place in my.ini file and now my result show value=3 . But it is not working for three character search. I've restarted server. How can i achieve to be able to

Dropping noise words in SQL Server 2005 full text indexing

人盡茶涼 提交于 2019-12-18 18:29:37
问题 In a pretty typical scenario, I have a 'Search' text box on my web application which has user input passed directly to a stored procedure which then uses full text indexing to search on two fields in two tables, which are joined using appropriate keys. I am using the CONTAINS predicate to search the fields. Before passing the search string in, I do the following: SET @ftQuery = '"' + REPLACE(@query,' ', '*" OR "') + '*"' Changing the castle to "the*" OR "castle*" , for example. This is

Noise Words in Sql Server 2005 Full Text Search

余生颓废 提交于 2019-12-18 17:13:32
问题 I am attempting to use a full text search over a series of names in my database. This is my first attempt at using full text search. Currently I take the search string entered and put a NEAR condition between each term (i.e. entered phrase of "Kings of Leon" becomes "Kings NEAR of NEAR Leon"). Unfortunately I have discovered that this tactic results in a false negative search result because the word "of" is being dropped by SQL Server when it creates the indexes because it is a noise word.

How can I do a full-text search of PDF files from Perl?

拟墨画扇 提交于 2019-12-18 15:54:06
问题 I have a bunch of PDF files and my Perl program needs to do a full-text search of them to return which ones contain a specific string. To date I have been using this: my @search_results = `grep -i -l \"$string\" *.pdf`; where $string is the text to look for. However this fails for most pdf's because the file format is obviously not ASCII. What can I do that's easiest? Clarification: There are about 300 pdf's whose name I do not know in advance. PDF::Core is probably overkill. I am trying to

How do you do full text search (FTS) with Linq to ADO.NET entity framework?

梦想与她 提交于 2019-12-18 15:13:00
问题 Now that SQL Server 2008 has full text search built in. I'm looking to use it to power my website's search. I'm also looking at using ADO.NET entity framework for my ORM but I was wondering how do you do full text search (FTS) with Linq to ADO.NET entity framework? Is there any support in ADO.NET entity framework or am I stuck using the method of creating a function which uses the full text search predicates? 回答1: Entity Framework supports only a subset of the sql functionality available