full-text-search

7645 Null or empty full-text predicate

大憨熊 提交于 2019-12-17 10:47:27
问题 I have a query that ran fine on SQL2005 but moving the database to SQL2008 gives me the error from the title. The code that is the problem is a call to CONTAINS, CONTAINSTABLE or FREETEXT with an empty parameter. However I'm trying to only call or join when there is a value like such where (@search_term = '' or (FREETEXT(lst.search_text, @search_term))) or left join containstable (listing_search_text, search_text, @search_term) ftb on l.listing_id = ftb.[key] and len(@search_term) > 0 However

SQL Fuzzy Matching

二次信任 提交于 2019-12-17 10:43:01
问题 Hope i am not repeating this question. I did some search here and google before posting here. I am running a eStore with SQL Server 2008R2 with Full Text enabled. My requirements, There is a Product Table, which has product name, OEM Codes, Model which this product fits into. All are in text. I have created a new column called TextSearch. This has concatenated values of Product Name, OEM Code and Model which this product fits in. These values are comma separated. When a customer enters a

PHP mysql search multiple tables using a keyword

耗尽温柔 提交于 2019-12-17 06:27:30
问题 I have three tables in my database which are: messages topics comments Each of these tables has two fields called 'content' and 'title'. I want to be able to use 'Like' in my sql statement to look at 'messages.content', 'messages.title', 'topics.content', 'topics.title', 'comments.content' and 'comments.title' using a keyword. So far, my query is able to find results from only one table: mysql_query("SELECT * FROM messages WHERE content LIKE '%" . $keyword . "%' OR title LIKE '%" . $keyword .

How can I manipulate MySQL fulltext search relevance to make one field more 'valuable' than another?

五迷三道 提交于 2019-12-17 05:39:49
问题 Suppose I have two columns, keywords and content. I have a fulltext index across both. I want a row with foo in the keywords to have more relevance than a row with foo in the content. What do I need to do to cause MySQL to weight the matches in keywords higher than those in content? I'm using the "match against" syntax. SOLUTION: Was able to make this work in the following manner: SELECT *, CASE when Keywords like '%watermelon%' then 1 else 0 END as keywordmatch, CASE when Content like '

Choosing a stand-alone full-text search server: Sphinx or SOLR? [closed]

风流意气都作罢 提交于 2019-12-17 01:23:51
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I'm looking for a stand-alone full-text search server with the following properties: Must operate as a stand-alone server that can

Choosing a stand-alone full-text search server: Sphinx or SOLR? [closed]

一个人想着一个人 提交于 2019-12-17 01:23:26
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I'm looking for a stand-alone full-text search server with the following properties: Must operate as a stand-alone server that can

Is it possible to add your own strings to a Django SearchVectorField?

血红的双手。 提交于 2019-12-14 03:47:21
问题 I know how to do this with raw PostgreSQL commands, but want to know if there is a way to do this with Django PostgreSQL search. class Person(models.Model): name = models.CharField(max_length=64) description = models.CharField(max_length=256) active = models.BooleanField(default=False) search_vector = SearchVectorField(blank=True) def update_search(person): vector = SearchVector('name') + SearchVector('description') if person.active: vector = vector + SearchVector('alive') person.search

Cosines similarity on large data sets

元气小坏坏 提交于 2019-12-14 03:14:25
问题 Currently i'm studying about data-mining, text comparison and have found this one: https://en.wikipedia.org/wiki/Cosine_similarity. Since i have successfully implemented this algorithm to compare two strings i have decided to try some more complex task to achieve. I have iterated over my DB which contains about 250k documents and compared one random document from DB to whole documents in that DB. To compare all these items time was taken: 316.35898590088 sec, that's, - > 5 minutes to compare

Mysql Search for Domain Names

折月煮酒 提交于 2019-12-14 03:09:32
问题 I have a table full of domain names. I'd like to do a search that returns some kind of relevancy results on it. My problem, is that if I do a search for "cool" I want it to return "cooldomain.com", which a fulltext search, unless I'm doing it wrong, will not. Are there any fulltext options I'm unaware of that will accomplish this? If not, how would I go about doing it? 回答1: I'd use LIKE here, fulltext search is for matching against full words or expressions, query expansion, etc. And I think

Simulating field collapsing/grouping by field in Elastic Search

你。 提交于 2019-12-14 01:41:47
问题 Elastic Search does not currently (as of 0.18.4) support field collapsing. Is there a good way to simulate this, as to avoid N search queries? 回答1: Probably not the answer you're looking for but: As far as I know, and according to this ticket, the only real workaround is to select a larger result set and group on the client side. 回答2: Depending on what your use case is you might find parent/child support or nested types useful instead. You can find more about parent/child support here: https: