Configuration possiblities of simple search


is it possible to configure the simple search in such a way to exclude a certain metadata-field from beeing searched?

Best regards, Matthias Einbrodt

The simple search will search over all metadata fields.

It can't really be configured in the way you're hoping for.

Is it possible to show some more of the metadata fields in the results of a simple search? We have a bunch of different collections and it would be great if I could show which item is in which collection.

Or better, how do I set the simple search to give the same results view as an advanced search?

application/views/scripts/index.php controls the simple search view.

You can override this in a theme to add more information, but you'd probably have to do this on a model-by-model basis, checking if the current result is an Item, then using the Item and general metadata-printing functions as normal.

You can't simply use the same view as an advanced search, however. The "new" search results include other types of Omeka objects, unlike the old search which was limited to Items.


I have a couple of questions.

1) Is it possible to make "exact match" the default basic search type?

2) Is it possible to display thumbnails in the results of a basic (not advanced) search?

Our users are confused by the difference in look and feel between the display of basic search results and the display of advanced search results. Without thumbnails, the results of the basic search don't really look like a list of results at all.

Thanks very much for your help!

Just wanted to follow up on the above questions. The most urgent issue for our users is the lack of thumbnails in the site-wide search results. If it's possible to edit the code to display thumbnails in the site-wide search results, could you outline how I could do that? (We've restricted our site-wide search to items only, so everything should have a thumbnail.)

Thanks so much!

Is it possible to add thumbnails to the search results by making edits to application/views/scripts/search/index.php? This is what I have--could you tell me what I need to change? (BTW, I have restricted search on my site to items only.)

$pageTitle = __('Search Omeka ') . __('(%s total)', $total_results);
echo head(array('title' => $pageTitle, 'bodyclass' => 'search'));
$searchRecordTypes = get_search_record_types();
<?php echo search_filters(); ?>
<?php if ($total_results): ?>
<?php echo pagination_links(); ?>
<table id="search-results">
            <th><?php echo __('Record Type');?></th>
            <th><?php echo __('Title');?></th>
            <th><?php echo __('Thumbnail');?></th>
        <?php foreach (loop('search_texts') as $searchText): ?>
        <?php $record = get_record_by_id($searchText['record_type'], $searchText['record_id']); ?>
            <td><?php echo $searchRecordTypes[$searchText['record_type']]; ?></td>
            <td><a href="<?php echo record_url($record, 'show'); ?>"><?php echo $searchText['title'] ? $searchText['title'] : '[Unknown]'; ?></a></td>
            <td><?php echo $searchRecordTypes[$searchText['square_thumbnail']]; ?></td>
        <?php endforeach; ?>
<?php echo pagination_links(); ?>
<?php else: ?>
<div id="no-results">
    <p><?php echo __('Your query returned no results.');?></p>
<?php endif; ?>
<?php echo foot(); ?>

I keep meaning to respond here and forgetting about it.

Yes, you're basically on the right track with trying to edit search/index.php if this is what you want to do.

Inside the foreach loop, you've got a variable $record. Since your search is all items, you can count on this being an Item object (though you could do a check like instanceof Item if you want your code to work even if you eventually turn on more records to search).

After the line that assigns the record variable, you could do this:

set_current_record('item', $record);

Then you can use the normal item functions used elsewhere to output thumbnails or other data inside that loop, like item_image.