0

I have the Search API and the Solr search modules installed. In /admin/config/search/search-api, I see my server and index created and with status set to OK. I can see on the index view page that my content is indexed correctly.

Server and index ok

I did not use the Solr Search Defaults module because I have removed the default Article content type, and I don't want to recreate it. Without this content type, there is an error when activating the module.

How can I create a search page displaying all indexed results (for anonymous users, not in BO)?

One tutorial shows that Solr Search Defaults module uses views. I've created a view, where in View settings > Show I've selected Ideas index. In the view, Format > Show is set to Rendered entity. Search index is the view mode. I have a page, but no content is displayed. No filters are required, and all are exposed. enter image description here

Other tutorial says I should create a search page in Configurations > Search and metadata > Search pages menu, but I don't have that menu.


Here are my Fields for Ideas index. enter image description here Here is another view I've tried, with Show > fields enter image description here Here are my error logs, there is a Notice: enter image description here Here is what I see using {{ kint(page.content) }} on my Search results page: enter image description here If I create a view with VIEW SETTINGS > Show > Content my content IS diplayed correctly.

  • 1
    You probably have one or more filters set to "required" - if you clear those flags all results should be displayed I think – Clive Aug 12 '18 at 13:31
  • No, no filters are required. I've added my view to the description of the question, you can see. – Oksana Aug 12 '18 at 13:41
  • 1
    You don’t need the defaults module. Once content is being indexed you can either create a Views page or you can code it yourself using the Solarium client. – Kevin Aug 12 '18 at 14:18
0

After installing the searc api module:

1) goto: /admin/config/search/search-api/index/default_index/edit

If you want for example to search for both Users & Content at once, make sure that both entities for Content & Users under the Data sources section are checked.

2) Goto: http://site8.dd:8083/admin/config/search/search-api/index/default_index/fields

This page is used to choose which are the fields you want to be indexed for your search.

So make sure on this page that all the fields you want to search your entities by are added to your entities; If not, add any field using the +Add Fields button.

3) On the same page: http://site8.dd:8083/admin/config/search/search-api/index/default_index/fields

Any field you add, it has its own data type which you have also the permission to change it.

As per the data type table available at the bottom of the page:

Fulltext fields are analyzed fields which are made available for fulltext search. This data type should be used for any fields (usually with free text input by users) which you want to search for individual words.

so in your view, if you want to use the Fulltext search to search for your contents, every indexed field on this page should also be set to Fulltext data type.

4) Goto: http://site8.dd:8083/admin/config/search/search-api/index/default_index

And make sure that the index Status bar is 100% and so all your contents are indexed to be searchable.

When you have done the above, create a new view as per below:

  • Show: index default content index

  • Check Create page box

  • Display format Grid

  • Hit save and edit button.

Within the views configuration page:

Under add fields section:

  • add any fields you want and make sure the field title has the (indexed field) text.

Under the filter criteria section:

  • add the fulltext search field and exposed to visitors.

Here you go, visit your search page and enjoy.

If none of the above helped you, feel free to ask any other question in comments or update your current question.

  • Thank you. I had all this, and now tried also your way to use Format > Show > Fields. It still displays nothing. I expect to display all indexed content if there are no filters used. Right? – Oksana Aug 12 '18 at 14:01
  • 1
    Yes if no filters are used, all the indexed content should be displayed for you. Did you try 1) clear your caches ? 2) Re-index all your content ? 3) add all necessary field for your content from the search api configuration page ? If you did all the above and still no luck, i am affraid you will have to give access your view and configuration page so i can debug it for you ! – Charbel El Azzi Aug 12 '18 at 14:17
  • I've done 1-2-3. I've just updated the description with more screenshots, please, see if it helps. The site is on local environment only now, so no access is possible. – Oksana Aug 12 '18 at 14:33
  • I have checked all your configuration and everything seems to be correct ! In this page Here are my Fields for Ideas index, try to change the boost value for the fulltext type fields to a higher value for example 13.0 and if possible and you have time re-create your view using simplytest.me platform for easier debugging – Charbel El Azzi Aug 12 '18 at 14:54
  • I've set values to 13.0, then cleared caches, recreated a view just to test: no changes. I really do not figure out how to use simplytest.me, it seems Solr Search module does not exist there. – Oksana Aug 12 '18 at 15:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.