MyBB Community Forums

Full Version: Searching on keywords
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I am going to post this at the risk of someone pointing out the obvious.

When entering multiple keywords in a forum search, how are they handled (in a boolean way)? I thought search would use AND (i.e. keyword1 AND keyword2) or maybe even OR. But neither seems to be the case. Search seems to only use the first keyword.

For example, if I search all forums, titles only, I get unexpected results:
Keyword "background" yields 18 pages of results
Keyword "subscription" 4 pages
Two keywords "background subscription" 18 pages
Two keywords "subscription background" 4 pages

What gives? Are keywords after the first ignored? Is there a way around this?

This is a real problem because I am new to MyBB and trying to learn a lot, but I'm having a tough time finding information without poring over pages of search results.
see this (read complete thread if you have time)
Thanks for replying so quickly. this is driving me crazy.

I read the whole post but I'm still not sure I understand. Moreover, I don't know where I can check the setting on my board (it's a prototype I'm setting up). I am using MySQL as the db, so I think I should I have options. I'd search to find the setting, but ......

From what I gather, one search (FULLTEXT?) allows boolean search. What does the other do? What is the other setting/type of search called?
^ admin panel >> configuration >> settings >> Search System >> Search Type -->
Quote:Please select the type of search system you wish to use. You can either chose between "Standard",
or "Full Text" (depending on your database). Fulltext searching is more powerful than the standard
MyBB searching and quicker too.
I looked there already, but there isn't a place to specify "search type". There are two items that pertain to search, "Enable search engine friendly URLs?" and "Enable search engine friendly URLs in Archive?", but neither one does it.

Are we getting clues as to my problem?
^ don't you have drop down selection box with standard and full text options at -->
admin panel >> configuration >> settings >> Search System >> Search Type

"Enable search engine friendly URLs?" <-- this is at another location !
So I got confused. Right now I am not concerned with how to search on my site; I am trying to search on your (mybb.com) site.

I come back to my initial question: can I use boolean? and why does the order of keywords matter?
I can confirm it acts strange (it also catches only the first word) like here, except - when I use AND:
word1 word2 - 9 matches
word2 word1 - 4 matches
word1 AND word2 - 1 match
word2 AND word1 - 1 match

My Setting is: ACP > Configuration > Search System > Search Type: Full Text
Most tables are InnoDB, but mybb_posts and mybb_threads are MyISAM

(here, at MyBB.com, AND doesn't work, it must be something different in their setting)
Edit: In Advanced Search, it works better than in simple search, but still strange
+background +subscription (1 page)
background AND subscription (1 page)
background OR subscription (200 pages)
background subscription (200 pages)
subscription background (46 pages)
subscription OR background (46 pages)
^ may be this -->
Quote:It allows for full boolean operators such as +, -, ~, (, ) ...
So I still don't understand how OR or separating keywords by blanks (which should be the same as OR) works. It seems to only take the first keyword.

But I was able to get AND working which is what I really needed to prune searches. I found that "a AND b" works as does "a +b". But "a + b" does not (I'm not sure what it returns).

Strange. Thanks for the help. If you ever find more on this I'd be real interested.

I came across this site that explains how the boolean should work.

http://dev.mysql.com/doc/refman/5.5/en/f...olean.html

Some of the searches are really interesting in that they change relevance of terms in the search. I haven't tried them.

For example:
'+apple macintosh' finds rows that contain the word “apple”, but rank rows higher if they also contain “macintosh”.

> < These two operators are used to change a word's contribution to the relevance value that is assigned to a row. The > operator increases the contribution and the < operator decreases it. See the example following this list.
Pages: 1 2