full-text-search

MYsql FULLTEXT query yields unexpected ranking; why?

旧时模样 提交于 2019-12-22 12:28:35
问题 i'm trying fulltext search with tags but it doesn't works properly for me chek attached image please The query is: SELECT *, MATCH(tags) AGAINST ('tag3 tag6 tag4') AS score FROM items ORDER BY score DESC why does the score is not ordering in the right order fields? if you check the second row has all the tags i searched while the first field does not have tag3 keyword . i mean id fields order should be : 5,1,2 .. etc and NOT 1,5,2..etc where is my mistake? then i would like to search first in

Regexp and mysql: is there an “AND” operator

删除回忆录丶 提交于 2019-12-22 10:54:16
问题 I have a database of book titles and would like the user to be able to search for the titles without having to use their search terms in the exact order of the title. The search is done using a form which queries the database For example: I want them to be able to search Pride and Prejudice by asking for "Pride Prejudice" or "Prejudice Pride" instead of typing "pride and prejudice". I tried using REGEXP and exploding the search terms and then imploding them with an OR operator (|) [gives me

Fulltext search slow SQL V12 Azure

独自空忆成欢 提交于 2019-12-22 10:53:10
问题 Fulltext search is finally supported in SQL Server V12 at MS Azure. It works as expected, but the first time you run a search it's immensely slow. In fact it times out quite often. The consecutive searches runs very fast, though. Seems that the fulltext engine is loaded into memory. Anybody experienced the same thing? 回答1: This is expected as the FTS (word breaker) starts when needed. 来源: https://stackoverflow.com/questions/30798694/fulltext-search-slow-sql-v12-azure

T-SQL Contains Search and German Umlaut on SQL Server 2008 R2

≡放荡痞女 提交于 2019-12-22 10:46:17
问题 I am facing a problem on SQL Server 2008 R2 where I have to use a contains search while ignoring German Umlaute-Letters (ä, ö, ü). For all non German speaking developers: The German Umlaut-Letters can be represented as the regular underlying letter (a when using ä) and an e. So Müller is the same as Mueller and Bäcker is the same as Baecker. What we want to do is this: When searching for "Müller" we would like to find data containing "Mueller" as well as "Müller" and when entering "Mueller"

Lucene search by URL

六眼飞鱼酱① 提交于 2019-12-22 10:10:29
问题 I'm storing a Document which has a URL field: Document doc = new Document(); doc.add(new Field("url", url, Field.Store.YES, Field.Index.NOT_ANALYZED)); doc.add(new Field("text", text, Field.Store.YES, Field.Index.ANALYZED)); doc.add(new Field("html", CompressionTools.compressString(html), Field.Store.YES)); I'd like to be able to find a Document by its URL, but I get 0 results: Analyzer analyzer = new StandardAnalyzer(Version.LUCENE_30) Query query = new QueryParser(LUCENE_VERSION, "url",

MySQL search with uft8_general_ci is case sensitive for FULLTEXT?

 ̄綄美尐妖づ 提交于 2019-12-22 09:48:04
问题 I set up a MyISAM table to do FULLTEXT searching. I do not want searches to be case-sensitive. My searches are along the lines of: SELECT * FROM search WHERE MATCH (keywords) AGAINST ('+diversity +kitten' IN BOOLEAN MODE); Let's say the keywords field I'm looking for has the value "my Diversity kitten". I noticed the searches were case-sensitive. I double-checked my collation on the search table, it was set to utf8_bin . D'oh! I changed it to utf8_general_ci . But my query is still case

regular epxressions that matches the longest repeating sequence

限于喜欢 提交于 2019-12-22 09:40:49
问题 I want to match the longest sequence that is repeating at least once Having: T_send_ack-new_amend_pending-cancel-replace_replaced_cancel_pending-cancel-replace_replaced the result should be: pending-cancel-replace_replaced 回答1: Try this (.+)(?=.*\1) See it here on Regexr This will match any character sequence with at least one character, that is repeated later on in the string. You would need to store your matches and decide which one is the longest afterwards. This solution requires your

When will Postgres's full text search supports phrase match and proximity match?

我只是一个虾纸丫 提交于 2019-12-22 08:43:17
问题 As of Postgres 8.4 the database fts does not support exact phrase match, nor does it support proximity match if given 2 terms. For example, there is no way to tell Postgres to match on content that have word #1 which is in a specified proximity of word #2. Any one know the plan of Postgres and possibly which version will phrase and proximity match be supported? 回答1: PostgreSQL 9.6 text search supports phrases now select * from (values ('i heart new york'), ('i hate york new') ) docs(body)

Search in solr with special characters

别等时光非礼了梦想. 提交于 2019-12-22 05:17:23
问题 I have a problem with a search with special characters in solr. My document has a field "title" and sometimes it can be like "Titanic - 1999" (it has the character "-"). When i try to search in solr with "-" i receive a 400 error. I've tried to escape the character, so I tried something like "-" and "\-". With that changes solr doesn't response me with an error, but it returns 0 results. How can i search in the solr admin with that special character(something like "-" or "'"??? Regards UPDATE

SQL Server vs MySQL: CONTAINS(*,'FORMSOF(THESAURUS,word)')

此生再无相见时 提交于 2019-12-22 04:58:13
问题 I am shocked. I spent past 3-4 days figuring out how I could implement stemming (and synonyms searches) in mysql when I see in SQL Server the query is incredibly easly: Select * from tab where CONTAINS(*,'FORMSOF(THESAURUS,word)') Is possibile on MySql there isn't anything like that? 回答1: No, MySQL does not support matching against a user-provided thesaurus. You can use an external FULLTEXT engine like Sphinx which supports morphology rules, has several stemmers and thesauri built in and