Forums » Search not finding item

RSS feed for this topic

Info

  1. We've set up an Omeka site for a class. Today, we had a demo, and a user entered a term in the simple search bar that occurs in at least one item title, but the search returned no results. I found it curious and dug a little further, and here's what I observed.

    We have an item here:

    http://alanis.simmons.edu/bettie/items/show/644

    The title (DC) is "Snapshot of a dog". In the regular search bar, if I search for dog, I get no results. The query URL is:

    http://alanis.simmons.edu/bettie/items/browse?search=dog&submit_search=Search+scrapbook

    However, if I search for 'snapshot', I get the item back. The query URL is:

    http://alanis.simmons.edu/bettie/items/browse?search=snapshot&submit_search=Search+scrapbook

    The text "Teddy", which occurs in the DC description, also returns a result from the basic search.

    It gets interesting when I add advanced search to the mix. If I do a fielded search for titles containing the word 'dog', my item comes back in the results! The URL is:

    http://alanis.simmons.edu/bettie/items/browse?search=&advanced0element_id=50&advanced0type=contains&advanced0terms=dog&tags=&submit_search=Search

    Has anyone seen behavior like this? I had experimentally verified that terms in the title were searchable before we loaded our data. I'm not sure what could have changed.

    Thanks!

  2. The behavior you're seeing seems strange, but it's happening because of a few different things about the MySQL search that Omeka uses.

    The keyword or "simple" search is a MySQL fulltext search; it function somewhat similar to a Google search, but it has some restrictions. In your particular situation, the important restriction is that, by default, the search will not match any words that are fewer than 4 characters. So, this explains why "dog" doesn't give you any results in the regular search bar, but "Teddy" does.

    While this didn't affect your specific search, there's also a list of "stopwords", search terms which MySQL simply ignores because they are too common. The MySQL website has a list of default stopwords.

    Now, the "by specific field" search uses a different kind of searching, it will return results that are even parts of words, and it doesn't carry the restrictions that apply to simple search. So, the search for "dog" works the way you'd expect in the "by specific field" search, but not the "simple" search.

    If you're interested, the MySQL website also has instructions for altering these restrictions, but you'll need to be able to edit your MySQL server configuration to follow them.

  3. I had already checked MySQL's list of stopwords, but I hadn't seen anything about the length of the search terms, but your explanation is consistent with the problem. I'll have to decide whether we want to try to modify our MySQL server, switch to our Solr index, or leave things as they are.

    Thanks!

Reply

You must log in to post.