0

I would like to have my search like this.

Must "always" match a result in either title, catgory or tags for the word massive otherwise return no results.

If it find words massive and big in any/either title, catgory or tags rank higher that just (massive)

If matches massive and huge in any/either title, catgory or tags then rank even higher than just (massive) and (massive and big)

I would also like to ignore words, even if the word massive exists I dont want to return a row that matches small, tiny or miro in either title category or tags.

Also all words should be matched if the word is the begining of another word so for example biggest should match with the word big and smallest should match with the word small

So just to simplify...

Order of matched words, highest rank first:

Massive and huge
Massive and big
Massive

Ignore these:

small
tiny
micro

This is what I have but I don't know if its correct as i'm quite new to this.

MATCH(title,categorys,tags) AGAINST('+massive* huge* big* -small -tiny -micro' IN BOOLEAN MODE) ORDER BY rand() LIMIT 14

And this is my mysql indexes

Table  key_name Seq_in_index  column_name cardinality Null  Index_type
videoz title    1             title         1         YES   FULLTEXT        
videoz title    2             categorys     1         YES   FULLTEXT        
videoz title    3             tags          1         YES   FULLTEXT        

Am I on the right track, thanks for your time.

  • You can use `>huge` and ` – Solarflare Feb 19 '17 at 21:03
  • Thanks in that case as I dont want it to be too slow i think ill just find words, massive huge and big and ignore small, tiny and mirco. But I notice with my code it still finds records with the word small, my code must be wrong but i don't know why. – Luke Dobner Feb 19 '17 at 21:32

0 Answers0