MySQL Forums
Forum List  »  Full-Text Search

search based on words priority
Posted by: Amit Kumar
Date: June 06, 2017 05:09AM

Hi Team,

I am working on a search query.
in this query , if I am searching for " word_1 word_2 word_3"
then I want the output in the below priority:

" word_1 word_2 word_3 "
" word_1 word_2 "
" word_1 word_3 "
" word_2 word_3 "
" word_1 "
" word_2 "
" word_3 "

I tried all the option available but not sure how to get this done in a query.



SELECT issue_id,
identifier,
summary,
SUBSTR(content_text,1,200) AS content ,
MATCH(CONTENT_text) against(REPLACE('word_1 word_2 word_3 word_4 ', ' ' , ' +') ) AS score
FROM HOOTSEARCH.HOOT_DATA
WHERE MATCH(CONTENT_text) against(REPLACE('word_1 word_2 word_3 word_4 ', ' ' , ' +') IN BOOLEAN MODE ) ;

here we are using score so we can order the result on the based of priority.


PLEASE HELP

Options: ReplyQuote


Subject
Views
Written By
Posted
search based on words priority
1745
June 06, 2017 05:09AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.