How to search a default field in CKAN?

151 Views Asked by At

I want to be able to also search by specific field when i search in the search box.

Solr already has a 'text' field that is used by default and this field also covers other fields (e.g. title, notes, tags). It works when I query in Solr without specifying any fields. But when I search without specifying a field in the CKAN search box, it doesn't work.

This is exactly what I want:

When I type "example" directly instead of "title:example", I want it to automatically search in the fields specified in the CKAN schema.

1

There are 1 best solutions below

0
tino097 On

You should have enabled datastore extension to perform full text search

q (string or dictionary) – full text query. If it’s a string, it’ll search on all fields on each row. If it’s a dictionary as {“key1”: “a”, “key2”: “b”}, it’ll search on each specific field (optional)

https://docs.ckan.org/en/2.9/maintaining/datastore.html#ckanext.datastore.logic.action.datastore_search