Questions tagged [search]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
647 views

Craft Search looking for keywords contained in the query

Edited for clarity: I do have a search form in the frontend where customers can enter keywords. The way it searches now only returns exact matches. I'd like to tell Craft to look for works containing ...
1
vote
1answer
964 views

Filtering with multiple criteria

IM running into an issue where I have one page that lists latest restaurant entries in a given section. However I also have a form to filter the entries by postcode (a category element and by cuisine ...
2
votes
1answer
1k views

How to search by title field only?

How do I change this template code to only return results from the title field of an entry? The search result page url would look like this: /search-results?q=joe+blogs {% set query = craft.request....
1
vote
1answer
254 views

Search form generates blank page

I am trying to set up a search form in my website. Followed this tutorial on builtwithcraft documentation website. So in my top navigation bar I include this code <form class="navbar-form navbar-...
4
votes
1answer
769 views

Paginate an array with multiple filters

I'm looking to paginate and array with multiple filters. The current url would be: www.example.com/search?filter=shorts&type=leather&brand=sams Clicking on the next next link returns: www....
4
votes
1answer
704 views

Using search to display entries based on a value in a number field

I'm trying to return results based on a year stored in a custom field. For example, returning entries with a model year greater than 2006 and less than 2009. Is there a search syntax to support this? ...
5
votes
1answer
1k views

Search order “Score” criteria

Leading on from this question by Chris Lewis I can't seem to find anything on the technicals, but by what criteria "best-match to worst-match" calculated? For example, if I was to have, an entry ...
2
votes
2answers
416 views

Search, by just one user field - fullName?

I'm successfully listing user (authors) via search from the url, so /author/Tom+Bowler lists data and entries by that name with {% set getauth = craft.request.lastSegment %} {% for authordetails in ...
10
votes
2answers
2k views

Excluding fields in a search

Is it possible to exclude some fields when using search? Getting the q parameter from the URL and searching the products section including all fields: {% set query = craft.request.getParam('q') %} {%...
3
votes
0answers
622 views

Filter entries with segments and params based on categories and fields [closed]

I'm working on a webshop with an advanced filter / search with multiple categories, entry types and fields and sorting options. Schematic URL site.com/template/entry.type/category/?size=category OR ...
2
votes
1answer
2k views

How to search for content in a specific Matrix field?

I'm not entirely sure how to search a specific Matrix field for a given bit of content. I can use: {% for cta in entry.homeCtas.search('"Lorem Ipsum"') %} <h1>{{ cta.ctaTitle }}</h1> {...
1
vote
1answer
742 views

Search for matrix field in a global set

I've set up a global set "attachmentGlobals" with a matrix field inside named "globalFiles". This matrix has only one block "files" which has a text field "fileId" and an Asset field "fileAsset". I ...
1
vote
2answers
2k views

Fetching entries from an advanced search form on the front end

I'm trying to fetch entries from a channel via a front-end form featuring multiple filters - several dropdown selects and one checkbox field - kind of like an advanced search feature. The form works ...
5
votes
1answer
420 views

Modifying search scoring algorithm

Is there any way to tweak the way search score is calculated? For example, I would like words in the title field to be scored higher than the same terms in other fields.
2
votes
1answer
491 views

How can an entry type have its own search and categories?

I have an entry type whose content will be separated from the main content. So I was wondering how can we give an entry type its own search and categories? Possible?
11
votes
2answers
3k views

Advanced Search

Not sure of the best way to progress with this but i'm trying to create an advanced search on a Craft site. What it needs is a select dropdown for Authors, Categories and a normal text input. The ...
7
votes
1answer
764 views

Using “search” vs. “relatedTo” in a template

I have problems to understand the difference between search and relatedTo. From my understanding, this is a fulltext search on all fields. {% set entries = craft.entries.search(test).order('score') %}...
9
votes
2answers
3k views

How would I include the first category slug in the section's entry URL format?

I have a custom section that uses routes like this: /section/category/entry_url In trying to program the search form results I realized that I need to explicitly define the entry URL format for the ...
5
votes
3answers
2k views

Search for related entries based on tags

On an entry page I search for related entries based on the tags assigned to the respective entry. The following example works: {% set tags = entry.q_tags.first %} {% for tag in entry.q_tags.offset(1)...
4
votes
1answer
651 views

searching assets - using related entry slug

For a website I'm currently building I have a bunch of photos within an Assets folder (folder id of 5) that I have linked to "Photographer" entries within a "Photographers" structure. I am now trying ...
14
votes
2answers
4k views

How to paginate search results?

What’s the best way to paginate search results? I was using {% set query = craft.request.getParam('q') %} and then {% paginate craft.entries.search(query).section('…').limit(…).order('…') as ...
5
votes
1answer
193 views

Bug with non-ascii characters, quotes and OR operator in search?

There seems to be a bug when I combine non-ascii characters, quotes and the OR operator when searching. All of these queries work ok: "pølser" "pålegg" pølser OR pålegg "egg" OR "spekemat" but "...
15
votes
2answers
915 views

How can I display search “excerpts” from multiple sections?

How do I create search result page "excerpts" when there are multiple sections/fields that need to be represented?
11
votes
2answers
1k views

Search matrix for blocks with upcoming dates

I have a matrix field with one "event" block type that contains several fields. One of those fields is a date field. Is there a way to get just blocks with upcoming dates?

1 2 3 4 5
6