Search field doesn't return results with SOLR

Hi everyone,

I’m trying to set a search page on my omeka-s plateform using SOLR. I’m using omeka-s v. 2.0.2, I have install the latest version of the search adapter for Solr module and also the Search module.

I have follow the procedure to create an index and then a search page using the basic form. I have all my items on that page when I open it and I can dynamically use my facets to reduce the number of it, but everytime I type a word on the search field on that page and submit the form it returns no result.

Do you know what could be the problem ?

Thanks a lot for your help,

Does anyone have experience something like that ? Or have I done someting wrong ?

Thanks in advance for your help,

Based on the links you provided, you’re using Solr module from biblibre and the Search module from Daniel-KM. I haven’t tried but I think those two are not compatible with each other. Try to use both from biblibre or both from Daniel-KM

Hi @julian.maurice,

Thanks for your answer. Indeed … I used the wrong module. I’m using now Daniel-KM’s module, but I still have the same problem with the search field :slightly_frowning_face:

The module works, I use it in many places. Probably a setting forgotten somewhere, but hard to say without more info. Can you append screenshot of the config page? Is it working in admin too?

Note that my modules are no more compatible with the BibLibre one’s, so you have to choose which one to use. For my part, it’s Search and SearchSolr.

Hi @Daniel, thanks for your answer! I’m now using the Search and SearchSolr modules. I’m not sure which page you need to see, here is some of them and the config.module.php of the Search module if it’s usefull.
I tried to use the search bar on the admin board and I had the same outcome : no result on every of my queries.

<?php
namespace Search;

return [
    'api_adapters' => [
        'invokables' => [
            'search_indexes' => Api\Adapter\SearchIndexAdapter::class,
            'search_pages' => Api\Adapter\SearchPageAdapter::class,
        ],
    ],
    'entity_manager' => [
        'mapping_classes_paths' => [
            dirname(__DIR__) . '/src/Entity',
        ],
        'proxy_paths' => [
            dirname(__DIR__) . '/data/doctrine-proxies',
        ],
    ],
    'view_manager' => [
        'template_path_stack' => [
            dirname(__DIR__) . '/view',
        ],
    ],
    'view_helpers' => [
        'invokables' => [
            'searchForm' => View\Helper\SearchForm::class,
            'searchingForm' => View\Helper\SearchingForm::class,
            'searchingUrl' => View\Helper\SearchingUrl::class,
        ],
        'factories' => [
            'apiSearch' => Service\ViewHelper\ApiSearchFactory::class,
            'apiSearchOne' => Service\ViewHelper\ApiSearchOneFactory::class,
            'facetLabel' => Service\ViewHelper\FacetLabelFactory::class,
            'facetCheckbox' => Service\ViewHelper\FacetCheckboxFactory::class,
            'facetLink' => Service\ViewHelper\FacetLinkFactory::class,
            'searchIndexConfirm' => Service\ViewHelper\SearchIndexConfirmFactory::class,
            'searchRequestToResponse' => Service\ViewHelper\SearchRequestToResponseFactory::class,
        ],
    ],
    'block_layouts' => [
        'invokables' => [
            'searchingForm' => Site\BlockLayout\SearchingForm::class,
        ],
    ],
    'form_elements' => [
        'invokables' => [
            Form\Element\OptionalSelect::class => Form\Element\OptionalSelect::class,
        ],
        'factories' => [
            Form\Admin\AdvancedFormConfigFieldset::class => Service\Form\AdvancedFormConfigFieldsetFactory::class,
            Form\Admin\ApiFormConfigFieldset::class => Service\Form\ApiFormConfigFieldsetFactory::class,
            Form\Admin\SearchIndexConfigureForm::class => Service\Form\SearchIndexConfigureFormFactory::class,
            Form\Admin\SearchIndexForm::class => Service\Form\SearchIndexFormFactory::class,
            Form\Admin\SearchPageConfigureForm::class => Service\Form\SearchPageConfigureFormFactory::class,
            Form\Admin\SearchPageConfigureSimpleForm::class => Service\Form\SearchPageConfigureSimpleFormFactory::class,
            Form\Admin\SearchPageForm::class => Service\Form\SearchPageFormFactory::class,
            Form\Element\SearchPageSelect::class => Service\Form\Element\SearchPageSelectFactory::class,
            Form\AdvancedForm::class => Service\Form\AdvancedFormFactory::class,
            Form\BasicForm::class => Service\Form\BasicFormFactory::class,
            Form\FilterFieldset::class => Service\Form\FilterFieldsetFactory::class,
            Form\SearchingFormFieldset::class => Service\Form\SearchingFormFieldsetFactory::class,
            Form\SettingsFieldset::class => Service\Form\SettingsFieldsetFactory::class,
            Form\SiteSettingsFieldset::class => Service\Form\SiteSettingsFieldsetFactory::class,
        ],
    ],
    'controllers' => [
        'invokables' => [
            Controller\Admin\IndexController::class => Controller\Admin\IndexController::class,
            Controller\IndexController::class => Controller\IndexController::class,
        ],
        'factories' => [
            Controller\Admin\SearchIndexController::class => Service\Controller\Admin\SearchIndexControllerFactory::class,
            Controller\Admin\SearchPageController::class => Service\Controller\Admin\SearchPageControllerFactory::class,
        ],
    ],
    'controller_plugins' => [
        'invokables' => [
            'searchRequestToResponse' => Mvc\Controller\Plugin\SearchRequestToResponse::class,
        ],
        'factories' => [
            'apiSearch' => Service\ControllerPlugin\ApiSearchFactory::class,
            'apiSearchOne' => Service\ControllerPlugin\ApiSearchOneFactory::class,
            'searchForm' => Service\ControllerPlugin\SearchFormFactory::class,
            'totalJobs' => Service\ControllerPlugin\TotalJobsFactory::class,
        ],
    ],
    'listeners' => [
        Mvc\MvcListeners::class,
    ],
    'service_manager' => [
        'invokables' => [
            Mvc\MvcListeners::class => Mvc\MvcListeners::class,
        ],
        'delegators' => [
           'Omeka\ApiManager' => [Service\ApiManagerDelegatorFactory::class],
        ],
        'factories' => [
            'Search\AdapterManager' => Service\AdapterManagerFactory::class,
            'Search\FormAdapterManager' => Service\FormAdapterManagerFactory::class,
        ],
    ],
    'navigation' => [
        'AdminGlobal' => [
            'search' => [
                'label' => 'Search', // @translate
                'route' => 'admin/search',
                'resource' => Controller\Admin\IndexController::class,
                'privilege' => 'browse',
                'class' => 'o-icon-search',
            ],
        ],
    ],
    'navigation_links' => [
        'invokables' => [
            'search-page' => Site\Navigation\Link\SearchPage::class,
        ],
    ],
    'router' => [
        'routes' => [
            'admin' => [
                'child_routes' => [
                    'search' => [
                        'type' => \Zend\Router\Http\Literal::class,
                        'options' => [
                            'route' => '/search-manager',
                            'defaults' => [
                                '__NAMESPACE__' => 'Search\Controller\Admin',
                                'controller' => Controller\Admin\IndexController::class,
                                'action' => 'browse',
                            ],
                        ],
                        'may_terminate' => true,
                        'child_routes' => [
                            'index' => [
                                'type' => \Zend\Router\Http\Segment::class,
                                'options' => [
                                    'route' => '/index/:action',
                                    'constraints' => [
                                        'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
                                    ],
                                    'defaults' => [
                                        '__NAMESPACE__' => 'Search\Controller\Admin',
                                        'controller' => Controller\Admin\SearchIndexController::class,
                                    ],
                                ],
                            ],
                            'index-id' => [
                                'type' => \Zend\Router\Http\Segment::class,
                                'options' => [
                                    'route' => '/index/:id[/:action]',
                                    'constraints' => [
                                        'id' => '\d+',
                                        'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
                                    ],
                                    'defaults' => [
                                        '__NAMESPACE__' => 'Search\Controller\Admin',
                                        'controller' => Controller\Admin\SearchIndexController::class,
                                        'action' => 'show',
                                    ],
                                ],
                            ],
                            'page' => [
                                'type' => \Zend\Router\Http\Segment::class,
                                'options' => [
                                    'route' => '/page/:action',
                                    'constraints' => [
                                        'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
                                    ],
                                    'defaults' => [
                                        '__NAMESPACE__' => 'Search\Controller\Admin',
                                        'controller' => Controller\Admin\SearchPageController::class,
                                    ],
                                ],
                            ],
                            'page-id' => [
                                'type' => \Zend\Router\Http\Segment::class,
                                'options' => [
                                    'route' => '/page/:id[/:action]',
                                    'constraints' => [
                                        'id' => '\d+',
                                        'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
                                    ],
                                    'defaults' => [
                                        '__NAMESPACE__' => 'Search\Controller\Admin',
                                        'controller' => Controller\Admin\SearchPageController::class,
                                        'action' => 'show',
                                    ],
                                ],
                            ],
                        ],
                    ],
                ],
            ],
        ],
    ],
    'translator' => [
        'translation_file_patterns' => [
            [
                'type' => 'gettext',
                'base_dir' => dirname(__DIR__) . '/language',
                'pattern' => '%s.mo',
                'text_domain' => null,
            ],
        ],
    ],
    'js_translate_strings' => [
        'Automatic mapping of empty values', // @translate
        'Available', // @translate
        'Enabled', // @translate
        'Find', // @translate
        'Find resources…', // @translate
        'Processing…', // @translate
        'Try to map automatically the metadata and the properties that are not mapped yet with the fields of the index', // @translate
    ],
    'search_adapters' => [
        'factories' => [
            'internal' => Service\Adapter\InternalAdapterFactory::class,
        ],
    ],
    'search_form_adapters' => [
        'invokables' => [
            'advanced' => FormAdapter\AdvancedFormAdapter::class,
            'basic' => FormAdapter\BasicFormAdapter::class,
        ],
        'factories' => [
            'api' => Service\FormAdapter\ApiFormAdapterFactory::class,
        ],
    ],
    'search' => [
        'settings' => [
            'search_main_page' => null,
            'search_pages' => [],
            'search_api_page' => '',
            'search_batch_size' => 100,
        ],
        'site_settings' => [
            'search_main_page' => null,
            'search_pages' => [],
            'search_redirect_itemset' => false,
        ],
        'block_settings' => [
            'searchingForm' => [
                'heading' => '',
                'search_page' => null,
                'display_results' => false,
                'query' => '',
                'query_filter' => '',
                'template' => '',
            ],
        ],
    ],
];

Hi,
The file config.module.php should never change.
Which version of Solr do you use?
And what about the config of the page :

I’m using the Solr v. 6.6.6.
The config page :

I remember this issue some years ago, but I don’t know for now, I need to do some debug to find the issue.

So I can send you a module with some added logging code to find the issue, but you will have to install it and to send me the logs.

Asbolutely, you can send me the module with the logging code. Thanks a lot!

Do you need a private webmail adress ? Or the intern webmail of the forum is ok ?

I found an issue that may be the one you have: in newer versions or in some configs of Solr, there is no default field by default, so the default query returns nothing, because it searches nowhere. I’ll publish a new version soon to add it automatically in the default mapping.

As a quick workaround, you can add the default field _text_ with * as source, then run a indexation:

See the Solr guide about catchall copy field.

What is your solr version? Is it fixing it?

1 Like

Your solution fix the problem!

Thank you a lot @Daniel_KM!

This topic was automatically closed 250 days after the last reply. New replies are no longer allowed.