Questions tagged [search]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
11
votes
2answers
4k views

How to filter entries by clicking multiple categories on front end

I would like to be able to filter my entries list by multiple categories on the front end. For example, if I first click a category button "lunge" then the results would show entries which are ...
14
votes
1answer
3k views

Is it possible to exclude multiple sections from an entry search query?

I'm trying to build a search function that excludes results from certain sections all together. This is the code I was trying to use. {% set entries = craft.entries.search(query).section('not ...
8
votes
1answer
1k views

Building a simple search by multiple categories

Is it possible to build the following/is it the right way in Craft. Been through the docs and searched but stuck. I just need to build a form on one page with a dropdown select for 2 categories; ...
4
votes
2answers
2k views

Building Results From Advanced Search Form

I'm building an advanced search form and having some difficulty with getting the results. The form inputs include price and year ranges. For example, search for used cars from $10,000 to $20,000. The ...
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?
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') %} {%...
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
2k views

Search against a checkboxes field's options

I have a relatively simple structure for products that I am building an advanced search for. I access the products using craft.entries.section('products'), but these products have fields with options ...
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') %}...
6
votes
1answer
1k views

Searching a specific section by four different types of parameters?

I'll do my best to explain this. I have a Portfolio of companies, which I have as a structure, that I need to be able to filter/search through by using up to four different parameters. Keyword - a ...
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 ...
6
votes
4answers
794 views

What is the best way to track, record or view search terms?

Pretty much like the title says - What is the best way to track, record or view search terms when using the built in Search form?
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 ...
1
vote
1answer
664 views

Linking to Search Results

Ok what i'm trying to achieve is a set of links which have "search parameters" attached to them. Which would be a "category" and an "option.field". Then when these links are clicked they display ...
9
votes
1answer
579 views

Ignore fields in search index

I have a site with ~ 25000 entries, and around 130 custom fields. I tried to rebuild the search index and it didn't complete after 8hours of running none stop. Whilst I'm sure this can be blamed on ...
4
votes
1answer
237 views

Limit search results for users by tag (and limit to 5 tags)

I've read as many forum posts and documentation but am a little stumped over a specific use-case. Currently the search page grabs the url segment, loops through a verified user group, and uses the ....
2
votes
0answers
375 views

Searching for Multiple Categories and Tags

I've been pulling my head for the past day on how to filter products with multiple categories. After a long search, I found and implemented on my project, Advanced Search with tags and categories It ...
10
votes
1answer
5k views

Advanced query/filter based on date and values

I have a channel of events with a field ‘eventDate’ for the date/time of the event. Within that there are ‘types’ of events ‘eventType’. What would be the most efficient way of outputting the NEXT (...
8
votes
2answers
2k views

Filter based Search Form

Previously on EE I've used Low Search to generate a filter based search form, based on categories. But with Craft I can't seem to find an add-on - Or even know if I need one! What I'm trying to ...
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 ...
6
votes
3answers
11k views

Filter Entries by Field Value

How do I filter a list of entries by the value of a field? For example, if I have a lightswitch field called "Featured", how do I output just the featured entries?
4
votes
1answer
801 views

Search Results In a Drop List/Popup on Same Page

Does anyone have an example how I would implement search results that appear in a popup on the same form (without redirecting to a results page). The idea would be that as they start to type in the ...
4
votes
1answer
764 views

Craft 3 Multi Category and Field Search

Looking for the solution to searching entries in one section that are related to multiple categories and match number field criteria. This is for a used auto website. Categories: Make/Model/Trim: ...
3
votes
1answer
737 views

Search across Entries and Assets and paginate combined results

I need to search both entries and assets and paginate the combined result. I have tried: {% set entries = craft.entries.search(query|trim).order('score').status('pending, live').find() %} {% set ...
3
votes
2answers
2k views

How to query using variables

I'm having issues with getting results from a query. I have 2 search parameters which i have set to variables. I would like to match both of these to get results. At the moment the query is returning ...
2
votes
1answer
947 views

How to filter entries in multiple category groups by selecting multiple categories

This question is very similar to the question posted here I have asked in the comments but my requirements are slightly different. I am trying to filter search results by categories in more than one ...
2
votes
1answer
836 views

Advanced Search with tags and categories

Been scratching my head for the past day on how to implement search with multiple categories. At the moment, I have product categories as a select dropdown which only allows to search in one ...
5
votes
3answers
934 views

Filter entries by entry type in the CP?

We have a channel called Articles with multiple entry types. Is it possible to filter the entries within Craft (on the Entries page) by entry type?
2
votes
1answer
678 views

Searching for entries across multiple fields including a relationship

I'm trying to fetch a set of entries based on search parameters. The search is an "and" search, meaning that if criteria exist then they should all match for there to be a result returned. I have ...
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.
3
votes
1answer
1k views

How do I combine search for categories and entries into one set of search results?

I have a search page. I can search either categories or entries using {% set entries = craft.entries.search(query).order('score') %} {% set categories = craft.categories.search(query).order('score') %...
3
votes
2answers
1k views

Converting array of entries to an array of ids

If I've got an array of entries, is there a less long winded approach to convert that to an array of ids so I can use it in another lookup. {# Look up authors that match the entered query. {% set ...
2
votes
2answers
2k views

How to filter entries based on Tags

I am working on a site that requires a filter option based on tags. Each entry will have two sets of tags (e.g., colors and shapes) {% for tag in craft.tags.group('colorTag') %} {% for tag in craft....
2
votes
1answer
449 views

Order by fields after searching

I need to order the results of a search query after I got back the results. The reason to do this is that I want to make different lists on the same page (with the same results) and I dont't want to ...
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 ...
5
votes
1answer
1k views

multiple search

My question could seem obvious but I don't find the solution. How to make a search on two fields, like: craft.entries.section('pages').search('foo:bar foo2:bar2') I tried search('foo:bar', 'foo2:...
3
votes
1answer
712 views

How to search using partial words?

Is it me, or can we not search using partial words in Craft CMS? This seems to be the case in the backend when search entry titles or assets, but a client has recently pointed it out on the front-end ...
2
votes
1answer
267 views

Is Craft's search() case-insensitive?

Is Craft's Search case-insensitive? (And is there a way to toggle case-sensitivity on/off?)
2
votes
1answer
199 views

Case sensitive craft.entries.search() in Craft

From Brad's answer to this question it's obvious that Craft doesn't have a case sensitive search from the start, but he mentions that it depends on MySQL database and table collation. My question is ...
2
votes
1answer
197 views

How to exclude certain fields from .search()

I have an event section in my website with a couple of fields on the entries and one of them is a "related events" field where I can select a other event entries to be shown at the end of the page. I ...
1
vote
1answer
310 views

Fuzzy search in Asset Library

Has anyone out there found a way to do a fuzzy search in the Asset Library? Currently, search only seems to return results that match the exact search query. Any help or plugin link is greatly ...
1
vote
3answers
303 views

Search/Filter Freeform submissions by field value

I need to be able to get a count (in the frontend) of the number of submissions that have a field with a specific value. I don't need the submitted data of the submissions, just the count of ...
1
vote
2answers
91 views

Tag mysteriously not found

Weird issue where a tag was not found using the tags search query. That tag is in the CMS (in news entries) as well as the DB, and even shows up in other queries. Query in question: {% set tag =...
1
vote
1answer
296 views

Search entries by location or name

I have a page that lists all of the property developments of my client, and am able to show the lists of the categories in the dropdown fields, but I can't work out how to get them to actually change ...
1
vote
0answers
413 views

Advanced filtered search: Matrix fields and arrays

Having scoured the forums for similar questions of which there are a few, I'm still struggling to figure out my specific usecase. I have 4 filters and a search box (which searches a custom tag field) ...
1
vote
1answer
283 views

Fuzzy Search and Plurals

So I’ve got fuzzy search activated and it works as it should... going to the right; but if I have a plural? Is there no way around this? Search term: "intaglio" = 12 results … includes "intaglio" and ...
0
votes
1answer
498 views

Searching members fields [closed]

I'm building a Users search page. I want to search the members group based on the following fields that I've setup for Users: First Name Last Name Company Name (handle: genericCompany, type: Plain ...
0
votes
0answers
128 views

How to exclude some fields from the searchindex using the RegisterElementSearchableAttributesEvent event?

Context I had big issues on a Craft 2 multilingual site with dozens of thousands of entries that were using Matrix fields. The site had become extremely slow (almost unusable), especially when ...