Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Setting Default Site Search to AND instead of OR


Go to End


4 Posts   1639 Views

Avatar
Tama

Community Member, 138 Posts

30 July 2010 at 11:16am

Howdy

I've tried searching for this but because of nature of the subject searching for "search and or" doesn't return very helpful results.

When we run a search on our current website using multiple words it returns all the pages which contain some of the words.

i.e. Searching for "quick brown fox"
Returns all of the pages which contain "quick" OR "brown" OR "fox"

What we'd really like is that if multiple words are typed in only pages contain all of the words.

i.e. Searching for "quick brown fox"
Returns only the pages which contain "quick" AND "brown" AND "fox"

We can manually trigger this search by typing in "+quick +brown +fox" but would the search default to the AND behaviour. It should be possible to add "+" to the beginning of each word in the search terms but I was wondering if there's a more elegant way.

How have other people gone about this?

Cheers
Tama

Avatar
Tama

Community Member, 138 Posts

2 August 2010 at 11:11am

Bump - surely others have come across this issue?

Avatar
Shauna G

Community Member, 52 Posts

3 August 2010 at 5:55am

Have you checked out the Sphinx Search module? It has a lot more features and options and might have what you're looking for.

Avatar
Tama

Community Member, 138 Posts

5 August 2010 at 9:59am

Hi Shauna

I did look at Sphinx but our public launch is only a week away so trying to get that up and running along with everything else seemed like a mission and a half.

Cheers
Tama