relevance

MySQL: Why score is always 1 in Fulltext?

时间秒杀一切 提交于 2019-11-28 22:09:47
If I run this query and print the score of each rows, they are always 1: Here are some sample query results: First | Last | Score ------------------------------ Jonathan | Bush | 1 Joshua | Gilbert | 1 Jon | Jonas | 1 And this is the query that I run: SELECT First, Last, MATCH(First, Last) AGAINST ('Jon' IN BOOLEAN MODE) AS score FROM users WHERE MATCH(First, Last) AGAINST('Jon' IN BOOLEAN MODE) ORDER BY score DESC; The BOOLEAN MODE supports only binary answers, means 0 or 1 whether the search string appears in the column or not. To get a decimal result to calculate a weight, you have to use

Mysql fulltext search relevance across multiple tables

半世苍凉 提交于 2019-11-28 17:06:39
I have been tasked with creating a site wide search feature. The search needs to look at articles, events and page content I've used MATCH()/AGAINST() in MySQL before and know how to get the relevance of a result but as far as I know the relevance is unique to the search (contents, number of rows etc) the relevance of results from the articles table wont match the relevance of results from the events table. Is there anyway to unify the relevance so that results from all three tables have a comparable relevance? Yes, you can unify them very well using a search engine such as Apache Lucene and

How to provide most relevant results with Multiple Factor Weighted Sorting

匆匆过客 提交于 2019-11-28 15:23:39
I need to provide a weighted sort on 2+ factors, ordered by "relevancy". However, the factors aren't completely isolated, in that I want one or more of the factors to affect the "urgency" (weight) of the others. Example: contributed content ( articles ) can be up-/down-voted, and thus have a rating; they have a post date, and they're also tagged with categories. Users write the articles and can vote, and may or may not have some kind of ranking themselves (expert, etc). Probably similar to StackOverflow, right? I want to provide each user with a list of articles grouped by tag but sorted by

Solr: QueryElevationComponent requires StrField uniqueKeyField error

自作多情 提交于 2019-11-28 13:39:01
I recently installed solr. The example index (found at apache-solr-#.#.#\example\solr) seems to work, and, once copied to my solr home directory, I am able to access it through the admin pages. However when I try to implement a new index by replacing the schema.xml content with (taken from here ): <?xml version="1.0" encoding="UTF-8" ?> <schema name="example" version="1.2"> <types> <fieldType name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true" /> <fieldType name="int" class="solr.TrieIntField" precisionStep="0" omitNorms="true" positionIncrementGap="0" /> <fieldType

How are results ordered in solr in a “match all docs” query

不想你离开。 提交于 2019-11-28 11:27:30
When I use a "match all docs" query, ' *:* ', asterisk colon asterisk, how are the results ordered? I presume they get ordered by relevancy, but the relevancy is equal in this case, right? So then, what's the scheme? When two documents have the same score, Lucene sorts them by index order (the first which has been indexed first) so that running a query twice returns documents in the same order. Since MatchAllDocsQuery gives a constant score to all documents, it returns them in index order. 来源: https://stackoverflow.com/questions/10310194/how-are-results-ordered-in-solr-in-a-match-all-docs

MySQL: Why score is always 1 in Fulltext?

依然范特西╮ 提交于 2019-11-27 14:16:16
问题 If I run this query and print the score of each rows, they are always 1: Here are some sample query results: First | Last | Score ------------------------------ Jonathan | Bush | 1 Joshua | Gilbert | 1 Jon | Jonas | 1 And this is the query that I run: SELECT First, Last, MATCH(First, Last) AGAINST ('Jon' IN BOOLEAN MODE) AS score FROM users WHERE MATCH(First, Last) AGAINST('Jon' IN BOOLEAN MODE) ORDER BY score DESC; 回答1: The BOOLEAN MODE supports only binary answers, means 0 or 1 whether the

Solr: QueryElevationComponent requires StrField uniqueKeyField error

Deadly 提交于 2019-11-27 07:49:14
问题 I recently installed solr. The example index (found at apache-solr-#.#.#\example\solr) seems to work, and, once copied to my solr home directory, I am able to access it through the admin pages. However when I try to implement a new index by replacing the schema.xml content with (taken from here): <?xml version="1.0" encoding="UTF-8" ?> <schema name="example" version="1.2"> <types> <fieldType name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true" /> <fieldType name="int"

How are results ordered in solr in a “match all docs” query

﹥>﹥吖頭↗ 提交于 2019-11-27 06:20:24
问题 When I use a "match all docs" query, ' *:* ', asterisk colon asterisk, how are the results ordered? I presume they get ordered by relevancy, but the relevancy is equal in this case, right? So then, what's the scheme? 回答1: When two documents have the same score, Lucene sorts them by index order (the first which has been indexed first) so that running a query twice returns documents in the same order. Since MatchAllDocsQuery gives a constant score to all documents, it returns them in index

MySQL - How to ORDER BY RELEVANCE? INNODB Table

本小妞迷上赌 提交于 2019-11-27 06:07:46
I've got about 20,000 rows in an INNODB table called 'cards', so FULLTEXT is not an option. Please consider this table: id | name | description ---------------------------------------------------------- 1 John Smith Just some dude 2 Ted Johnson Another dude 3 Johnathan Todd This guy too 4 Susan Smith Her too 5 Sam John Bond And him 6 John Smith Same guy as num 1, another record 7 John Adams Last guy, promise So, say the user searches for 'John', I want the result set to be in the order of: 7 John Adams 6 John Smith 3 Johnathan Todd 5 Sam John Bond 2 Ted Johnson Please note that we've only

MySQL - How to ORDER BY RELEVANCE? INNODB Table

徘徊边缘 提交于 2019-11-26 11:54:37
问题 I\'ve got about 20,000 rows in an INNODB table called \'cards\', so FULLTEXT is not an option. Please consider this table: id | name | description ---------------------------------------------------------- 1 John Smith Just some dude 2 Ted Johnson Another dude 3 Johnathan Todd This guy too 4 Susan Smith Her too 5 Sam John Bond And him 6 John Smith Same guy as num 1, another record 7 John Adams Last guy, promise So, say the user searches for \'John\', I want the result set to be in the order