Questions tagged [search]
The search tag has no usage guidance.
318
questions
0
votes
0
answers
30
views
Change search result order?
I want to figure out how to change our CRAFT CMS-built website's search functionality to deliver search results in descending chronological order. Currently, the oldest entries are at the top and ...
1
vote
1
answer
32
views
Update Search Index on Entry create and update
I have a multiselect drop-down for age group and I have set "Use this field’s values as search keywords" check box checked.
when I create a new entry or update existing entry . we are not ...
0
votes
0
answers
28
views
How do I customize the searchScore?
In my article listing page, I have a search function. I define the article query like so:
{% set orderByRule = 'postDate DESC' %} {# Default order. #}
{% if searchQuery is not null %}
{% set ...
1
vote
1
answer
56
views
Sprig replacing search field even with s-preserve="true"
I have a relatively simple search of a section called articles. Each entry within articles has a category assigned. I've named the category animal.
Layout is as follows:
Header
Search/filtering ...
1
vote
1
answer
34
views
How do I search entries by multiple tags that are in different tag groups?
My search form has a drop down of tags from different tag groups.
My current search code for the input query is
{% set sentries = craft.entries({
search: query,
...
1
vote
1
answer
35
views
Hiding categories in real time with Sprig in a faceted search
I've built three buttons with checkbox dropdowns that display categories that filter the content below based on categories. I am currently using the relatedTo function to only display the categories ...
1
vote
1
answer
38
views
Display entry field if it contains search query
Is it possible to display an entry field in search results if it contains the search query?
Context: I have an entry with a list of PDF assets. I want to show an asset in the search results if it ...
0
votes
0
answers
15
views
Commerce - Language-Switch / Search - Problem with "entry"
We use Commerce - and there we have the problem with the search or e.g. the language changer, because we work with "entry" and Commerce does not know that. Does anyone know how we can solve ...
0
votes
0
answers
46
views
Element-api search with space in query returns zero data
I have an endpoint for searching entries via the element api.
'api/searchtherest.json' => function () {
$section_handle = 'openFunding';
$criteria = [
'...
0
votes
0
answers
39
views
Possible to disable the search system?
Wondering if it's possible to completely disable the search if the site doesn't need it. In WordPress I'm able to detect when is_search() and then setup a redirect, as well as a redirect in the search ...
1
vote
1
answer
47
views
Manipulating search event
Looking at a means to perform subqueries against certain searches in the back-end of the Craft CMS eg for searches against particular sections within Admin > Entries.
Looking into this it seems ...
1
vote
2
answers
31
views
Product Search - redactor description field not indexing
I am struggling to get my head around plurals and fuzzy search etc.
I have seen this article, which seems to help answer this but am hoping someone can clarify based on my scenario
Search forms ...
1
vote
1
answer
58
views
Search query for assets
I build a search component, and it works fine.
Now I would like to show all the uploaded assets from a specific page ("Downloads") in the search results that include the search key.
How can ...
1
vote
1
answer
126
views
Search within matrix Block content
I have a frontend search form and I want to search within a matrix block. I have checked the box to make this field searchable.
And I'm using the expanded search plugin.
Here is my results code
{% ...
0
votes
1
answer
28
views
Craft3 CMS Website Search form is not updating results if I do a new search?
I'm upgrading a website from Craft2 to Craft3 on the previous website I implemented website search and work without any issues, but on the new site, I can do an initial search and get results without ...
2
votes
2
answers
30
views
Search results URL appearing in search results
On the site levellegal.com, when you search for certain words or phrases, one of the URL's in the search results will be the search results itself. A good example is to search for "antitrust"...
1
vote
1
answer
481
views
Search on multiple custom fields with a query parameter
I would like to use a query term for multiple fields according to their fields' handle in Craft cms 3.5.x, but unfortunately only for field title that works correctly, while for the other fields i get ...
0
votes
1
answer
61
views
Commerce search: return products containing keywords in related entries' fields
Craft CMS 3.6.11.2 / Commerce 3.2.17.4
We have a Stores structure section that contains fields (searchable) such as phone, address, etc. These Stores are assigned as Entries (searchable, max of 1) to ...
1
vote
1
answer
435
views
How to use Sprig to filter categories using a dropdown
I'm having an issue where I'm adding a dropdown to my search to filter through the first parent attribute in a category (Winter 2020, Spring 2021, and so on). The search field works, but nothing ...
1
vote
1
answer
151
views
Search for assets containing a custom field
How can I search for assets containing a custom field? The field on the asset is called lang. When I use this code no assets are found.
{% set folderId = craft.app.request.getQueryParam('folderId') %}
...
1
vote
1
answer
306
views
Sprig - Filter entries by custom field checkbox values, separate values as well as all values
I am having a question regarding Sprig.
I do want to filter my entries for values that are defined in a dropdown field (example below is simplified).
It does work to the point where I want to filter ...
1
vote
1
answer
66
views
How to search for Entries that have a particular Category set within a Matrix field in the Control Panel?
I have an arrangement like this:
Entry type 'people'
└ Matrix field 'offices'
└ Block type 'office'
└ Category field 'building'
On the Entries screen, how can I search for people that have a ...
1
vote
1
answer
745
views
Filter entry query by a custom field value
I have a channel, 'pages'. Within that channel is a dropdown 'navigation'. The values in the dropdown are 'mainNavigation' and 'hidden'.
I'm trying to set an entry query that only pulls entries where ...
1
vote
1
answer
83
views
Why the entry-Variable doesn't exists after search?
I created a search form in my navigation and as it is described in the documentation, I created an search/results.html. And actually it works so far.
Now comes the problem: The results.html extends ...
1
vote
0
answers
87
views
New entries only searchable by title field
I've recently done an upgrade of our site and am having issues with finding entries in the admin.
I keep entries for people who register a product so we have fields like registrationSerial and ...
1
vote
2
answers
56
views
Specify a specific entry type in paramaters
I am currently searching within multiple sections on my site.
I'd like to limit one of the sections (courses) to a specific entry type (cce)?
Any help would be greatly appreciated!
{% set params = {
...
1
vote
1
answer
120
views
Add Redactor field to searchindex
Is it possible to add a redactor field to the search index? I'm importing about 160 posts from a WordPress blog and the client has said it is absolutely essential that the posts themselves are ...
2
votes
1
answer
83
views
Front End Search Related Entries
I have a front end search which is working fine when searching titles, however when searching for text in rich text fields, or an input field caseNumber or the title of a related entry there are zero ...
3
votes
2
answers
94
views
Twig search function doesn't work after upgrading to Craft 3
My client's Craft 2 site includes several templates which use search functions to return a product entry by an ID, like so:
{% set product = craft.entries.section('Product')
.search('...
1
vote
1
answer
310
views
Craft 3 - Twig search query for entry with custom EntriesField containing disabled entry
I have a search form with 1 simple input (q)
I also have 2 sections: SECTION-A & SECTION-B
The search is for entries within SECTION A.
The entry I'm searching for contains a custom entriesField ...
1
vote
1
answer
188
views
Filtering by lightswitch fields
Bit of an unusual one and sure must be missing something but know if we have a defined lightswitch field we want to filter against it can quite easily be done so like this:
{{ craft.products().myField(...
0
votes
0
answers
51
views
Adding custom "keywords" to the search index
Is it possible for us to manually inject our own keywords into the searchindex via an event or something? eg.
Event::on(Entry::class, Entry::EVENT_AFTER_SAVE, function (ModelEvent $event) {
$event-...
1
vote
1
answer
241
views
Craft search only shows results matching 'title' of entries
I´m doing a search on Blog entries, i want to get all relevant entries searching on several fields, and seems that only matches the title. I try already using search(query), now i added the fields, ...
0
votes
0
answers
22
views
Getting mixed results with key word searches
I am having a hard time understanding why some keywords in fields that are marked as "Use this field’s values as search keywords" are not showing in the results but others are. For example, ...
1
vote
1
answer
53
views
Query entries with latest video field containing a URL
I would like to set up a query to find the latest news article that has a video attached to it ('video' is a matrix field with a block type that is also called 'video' and a field called 'videoUrl').
...
0
votes
0
answers
175
views
Search results not showing all entries
I have a search results page that doesn't show all matching results. The result entries that do show appear to older entries that have smaller ID numbers, although I'm not sure if that has anything to ...
1
vote
1
answer
61
views
Search form - Passing only field params that are not empty or selected
Is it possible to have a search form pass (into the search query) the field params of only fields that have been populated/selected? For example, if the following form is submitted, both q and color ...
1
vote
1
answer
80
views
Within the CP, how can I filter the listed Entries based on a Lightswitch field value?
I tried these kind of searches in the CP search field (on top of the Entry list):
fieldHandle:true / fieldHandle:false
fieldHandle:1 / fieldHandle:0
fieldHandle:* / -fieldHandle:*
fieldHandle:not 1 / ...
0
votes
1
answer
71
views
Inconsistent search results in multi-site setup (prod/stage)
I have set up a staging site alongside production just like the docs describe (Craft Solo 3.4.24). I have copied the "Site Settings" for all sections and set the "Propagation Method&...
1
vote
1
answer
167
views
Comparing matrix blocks by type and field value
I’m trying to do something, the answer to which should be as simple as searching a Matrix field value but that’s not working for reasons I can’t fathom.
Setup
I have a Matrix field called programme.
...
0
votes
0
answers
81
views
Updating Search Indexes failing because of "rouge" invalid field handle
I'm on the latest build 3.5.3. I created a Lightswitch field type within a Matrix field in my local dev env and called it "colorBlock". No problems there. When I recreated this in my staging ...
1
vote
1
answer
70
views
Filter users: in group AND not in other group
Please could you advise on how to filter a user query, so that users from Group A are included, but not if they are also in Group B?
{% set vnp_users = craft.users
.group(['groupA', 'not groupB'])
...
1
vote
2
answers
303
views
Search not searching certain words - how to fix?
I have an entry about the U.K. TV show "Being Human". If I search "being" on the back end, it comes up with 0 results, same on the front end search.
Searching for "Human" ...
2
votes
1
answer
85
views
Searching on whole title returns no results
When a client site is searched by the whole title, the search results return zero.
If I search by a few words in the entry title then the entry is returned in the search results.
If i search with the ...
2
votes
0
answers
70
views
How to search/filter in CP by date range?
Is there a way in the control panel to list all entries with a date field between two dates? For example, last updated between 12/16/2019 and 2/15/2020.
Interested in doing this for both automatic ...
2
votes
1
answer
159
views
How to search against a specific field/s, and not every field related to an element?
I have the below. I want to only show results that contain the query in the the username or fullName attributes.
Because currently if I search for say Tom the search results will return users without ...
2
votes
1
answer
91
views
Filtering a Matrix block for future dates
I'm struggling with filtering future dates in a Matrix block that contains a date field.
I would like to display 'Open' or 'Closed' as the result of a condition checking if the value of matrix rows ...
0
votes
0
answers
69
views
Search Results not working as expected
I have a search results page set up where there are a number of parameters in the query string used to filter results. I've got 3 out of 5 of these working and am stuck on the final 2.
My full ...
2
votes
1
answer
189
views
How to search based on a Multi select category field in Craft 3?
I have a blog section with multi select categories. I want to filter all the blogs based on that multi select categories in the website. When I tried
.search('category:ui-ux OR category:web-designs')...
0
votes
0
answers
63
views
Add additional entry fields to backend search
The search field in the craft backend entry section searches the title and slug field by default. Is it possible to add custom entry fields to this search function (in my case e.g. a custom item ...