full-text-search

MySQL: Optimizing Searches with LIKE or FULLTEXT

三世轮回 提交于 2019-12-24 04:46:07
问题 I am building a forum and I am looking for the proper way to build a search feature that finds users by their name or by the title of their posts. What I have come up with is this: SELECT users.id, users.user_name, users.user_picture FROM users, subject1, subject2 WHERE users.id = subject1.user_id AND users.id = subject2.user_id AND (users.user_name LIKE '%{$keywords}%' OR subject1.title1 LIKE '%{$keywords}%' OR subject2.title2 LIKE '%{$keywords}%') ORDER BY users.user_name ASC LIMIT 10

MySQL match() against() won't return anything

主宰稳场 提交于 2019-12-24 03:48:27
问题 First query returns nothing, second returns 0 and third returns zero against all records. I removed IN NATURAL LANGUAGE MODE but no change. Any reason why? I've checked many examples e.g.: MySQL Full text search MySQL match() against() - order by relevance and column? how to get the result of mysql match against in form of percentage? DB) SELECT * FROM person WHERE MATCH(`name`, `middlename`, `surname`) AGAINST ('John' IN NATURAL LANGUAGE MODE); SELECT COUNT(*) FROM person WHERE MATCH(`name`,

How to search word or string on all fields in document with MongoDB?

我与影子孤独终老i 提交于 2019-12-24 02:13:09
问题 We have a situation where a user would like to have a single 'omni-box' for searching for a word\phrase anywhere in a document. Is MongoDB able to perform this search or would it have to be an explicit search of every field? 回答1: You need to create a wildcard text indexes like this: db.collection.createIndex( { "$**": "text" } ) You can the use the $text operator to performs a text search. As mentioned in the documentation: This index allows for text search on all fields with string content.

Aho-Corasick text matching on whole words?

笑着哭i 提交于 2019-12-24 00:58:20
问题 I'm using Aho-Corasick text matching and wonder if it could be altered to match terms instead of characters. In other words, I want the the terms to be the basis of matching rather than the characters. As an example: Search query: "He", Sentence: "Hello world", Aho-Corasick will match "he" to the sentence "hello world" ending at index 2, but I would prefer to have no match. So, I mean by "terms" words rather than characters. 回答1: One way to do this would be to use Aho-Corasick as usual, then

Elastic Search. _Score is null in aggregations. Why?

老子叫甜甜 提交于 2019-12-24 00:53:06
问题 I use ES v 1.7. ES returns _score just only in "hits" section, but i'm not interested in "hits", I need data from "aggregations" section of responce with _score . Why ES do like that and How to fix it? Requset: { "size": 1, "query": { "bool": { "must": [ { "match": {"_all": {"query": "test","operator": "and","fuzziness": "2"}}} ], "should": [ { "multi_match" : { "query": "test" ,"type": "best_fields" ,"fields": ["ObjectData.PRTNAME","ObjectData.EXTERNALID","ObjectData.contactList.VALUE","

how to structure data for searchability

五迷三道 提交于 2019-12-23 20:29:10
问题 I am writing a search application specifically for music playlists. The genre and file format differs from playlist to playlist, and sometimes within the playlist there are differences too. There is also a concept of "synonymous" tags (e.g. urban would cover both hiphop and r&b, but not the other way around). Below is a list of search terms and my expected results. gospel: should return all playlists with at least one gospel song. playlists with all gospel songs would be shown first. urban:

How to save documents like PDF,Docx,xls in sql server 2008

别来无恙 提交于 2019-12-23 19:26:32
问题 I develop a web application that let users to upload files like images and documents. this file divided into two parts : binary files document files I want to allow users to search documents that uploaded. specialy using full text search. What data types I should use for these two file types? 回答1: You can store the data in binary and use full text search to interpret the binary data and extract the textual information: .doc, .txt, .xls, .ppt, .htm. The extracted text is indexed and becomes

SQL Server 2012 Full Text Search on FILESTREAMS with Windows Encrypting File System (EFS)

强颜欢笑 提交于 2019-12-23 19:16:13
问题 This is basically a yes/no question, but it is appreciated if the answer includes supporting references and a how-to if the answer is "yes". Strangely, I couldn't find a definitive answer in MSDN or TechNet, and my instincts and experiments lead me to a "no" conclusion. Is it possible to use Windows EFS with SQL Server 2012's FILESTREAMS and FileTables and have Full Text Search work on those FILESTREAMS? TIA Additional Detail I have a Visual Studio SQL Project created that stamps out DBs with

ravendb combining Search with Where

白昼怎懂夜的黑 提交于 2019-12-23 15:26:41
问题 I am executing a raven query in C#, and utilising both the Where() and Search() extension methods. I need both these functionalities, because I need to only return indices with a specific Guid field, AND text that exists in a body of text. Unfortunatly, the Where extension method seems to not be compatible with the Search extension method. When I combine them I get a Lucene query like this: Query: FeedOwner:25eb541c\-b04a\-4f08\-b468\-65714f259ac2 MessageBody:<<request*>> Which seems to