My 2 search bars have different results

My Emiglio-themed Omeka site has 2 search options.

Search bar 1: a box with a magnifying glass at the top right.
Search bar 2: a “Search Items” button on the “Browse Items” page.

I find this confusing, especially because Search Bar 1 doesn’t work as well. For example, when I input “hay” to search for this photo of a “Hay baling crew,” Search Bar 1 can’t find it.

I think the improvement I want to make is to remove Search Bar 1. Please help me to do it, or share your suggestions.

Search bar 1 is the “full text search” which can find things other than items (like other kinds of pages) and uses a more efficient kind of searching. This search has restrictions that come from MySQL, and one that people hit often is that there’s a minimum length of words it will consider in the search: by default it’s usually 4.

Search bar 2 is the older item-specific “advanced” search which has more options and uses a different kind of search that tends to be slower but doesn’t have the same restrictions. For many sites the speed difference doesn’t matter.

You could hide the “search bar 1” with CSS using the CSS Editor (the relevant selector is #search-container) or by editing your theme to just take it out of the layout completely. You can also change MySQL’s settings to allow shorter words in queries to take effect there.

Thank you, I will use your code to hide Search bar 1. I wish I could put Search bar 2 in its place, but that’s probably asking too much.

However, Search Bar 2 is also problematic. It only finds exact phrases. Entering keywords “hay” and “crew” won’t find “Hay baling crew.” But entering “Bali” will, because Search Bar 2 doesn’t distinguish between letters and whole words.

Search Bar 2 still seems better than Search Bar 1, which can’t find an exact phrase. Entering “hay baling crew” in Search Bar 1 finds every Item with any of those words (except “hay,” of course).

Can I improve Search Bar 2, or get a better search bar? It seems like common sense to have one that will only find Items with ALL the keywords I enter in ANY order.

Hi @jflatnes, this question is really important to me. Can you please respond to it?

Not really… the simple search in the items advanced search is very simple and doesn’t provide you with many options.

You can modify “search bar 1” to improve it: you can turn off everything but items (that’s in Search settings) and you can alter the minimum word length to pick up more words: but changing that is a little involved, the setting is ft_min_word_len and has to be set in the MySQL server configuration. You could also change the engine of the search_texts table to InnoDB, which has some improvements to how fulltext search works. There’s also an “advanced” option for search bar 1 for doing exact match searches.

Hi @jflatnes, I raced to get my images up without considering this problem. I’m in shock. How can Omeka be an archiving software with such a faulty search engine, and one that doesn’t work like the Google search engine that we’re all used to?

I’m interested in your MySQL corrections, and I’ll try to implement them. How do I get the “advanced” option for Search Bar 1?

There’s often a “plus” or “three dots” button next to the main search bar that will show the advanced options. In some themes there’s a theme setting controlling whether that button is shown. The admin-side Search settings also let you set some of those “advanced” settings by default.

On the subject of Google, there’s always the option of just literally using Google for search, through a custom search widget or otherwise. As long as the content you want to search by is visible so Google can index it.