Questions tagged [search]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
40 views

Problems with search index using MySQL 8 and CraftCMS 4.8.0

I have been testing our site using MySQL 8.0.36, and all seems great other than the search index seems to be not working as expected as any entry search with a string over 10 characters in length ...
Watsonian's user avatar
1 vote
2 answers
32 views

Can I search multiple element types in one query?

Yup, this is a repeat of a question from 7 years ago. The github discussion seems to have died out 2 years ago. I can't do weird array merging due to pagination which accepts an element query. So it ...
Amanda Lutz's user avatar
0 votes
0 answers
38 views

Search Results - prioritize order by related field

I've got search working as expected on this site with the following code: {% set params = { section: 'inventions', limit: 10 } %} {% if searchQueryKeywords !="&...
CreateSean's user avatar
  • 1,973
0 votes
0 answers
24 views

Search within Matrix field doesn't work

recently I've found out that my search is not showing all the entries that it should. I'm on the Craft 3.9.10 I have a Matrix field with Use this field’s values as search keywords checkbox checked ...
Michal Bulla's user avatar
2 votes
1 answer
58 views

Wildcard searching for custom field queries

I've noticed that the * wildcard works for simple custom field queries, for example if I have three entries named Foo, Foo*, Foo*Bar, running craft.entries.title('Foo*').all() will get 3 results, and ...
gioppe's user avatar
  • 414
1 vote
1 answer
188 views

Search index doesn't update

I've needed to to add a few fields to the search index «Use this field’s values as search keywords» after quite a few entries already have been created. Now the search index doesn't seem to get ...
Marco's user avatar
  • 11
0 votes
0 answers
27 views

Disable specific search syntax with colon

I have a search page which searches in products. Unfortunately some of these products contain a colon : in the title. This triggers the search syntax that is built into Craft. How can I disable this ...
Matthias's user avatar
  • 181
2 votes
1 answer
61 views

Save Control Panel search filters? Craft 4

I love the new control panel search filters. However, I see no facility to save them, and nothing in the documentation. Is there way to do this?
4midori's user avatar
  • 656
1 vote
1 answer
38 views

How to disable/enable all entries in a channel?

I have a channel named Parts. And there are 160k+ entries in it. I originally imported them into the channel using the "Feed Me" plugin. But none of the entries will show up in search ...
Noah Yamen's user avatar
0 votes
0 answers
38 views

Search query by specific section with matrix 'entries' type field?

I need help with the search query. I have a structure: Page (entryType "structure") -> Matrix (fieldType "matrix") -> Collections ("blockType") -> Collections (...
Artem Yakovlev's user avatar
1 vote
1 answer
32 views

Searching with foreign charcters

We have a multisite installation that has Mandarin as one of its languages, and searches do not work at all for that site. Looking into it, it seems to be an issue with how Craft runs the SQL queries, ...
peirix's user avatar
  • 431
2 votes
1 answer
41 views

Search lightswitch field with disabled value

I want to exclude some entires from search, so I add a field hideFromSearch and enable Use this field’s values as search keywords It works when I search like Entry::find()->search('hideFromSearch::...
Thomas's user avatar
  • 69
1 vote
0 answers
85 views

Search query working locally, but not in production

I noticed that search (both on the public website and in the entries admin area) was not searching a given field. I checked the field and noticed that the "Use this field's values as search ...
vlasits's user avatar
  • 203
2 votes
1 answer
59 views

Structure entries not displaying in date order within search results

I have created a search results page to display matching entries to a search term, ordered by the most recent. The set-up works well for all entries which are not part of a structure. Results of ...
michellelclement's user avatar
0 votes
1 answer
45 views

Search query ignoring custom fields in search in search index

I have a site with around 300 entries and at least 50 custom fields. But I'm only getting results if the keyword(s) are part of the title field, I have the "Use this field's value as keywords&...
Azazel's user avatar
  • 101
0 votes
0 answers
51 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 ...
Erin 's user avatar
  • 11
1 vote
1 answer
538 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 ...
Amar Chand Yadav's user avatar
0 votes
0 answers
77 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 ...
InanisAtheos's user avatar
1 vote
1 answer
388 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 ...
InanisAtheos's user avatar
1 vote
1 answer
112 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, ...
joomkit's user avatar
  • 2,014
2 votes
2 answers
171 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 ...
Elektra Murphy's user avatar
1 vote
1 answer
109 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 ...
Andrew's user avatar
  • 13
0 votes
0 answers
83 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 = [ '...
joomkit's user avatar
  • 2,014
0 votes
0 answers
156 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 ...
liquidRock's user avatar
1 vote
1 answer
61 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 ...
Cole Henley's user avatar
  • 1,741
1 vote
2 answers
60 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 ...
Malcolm Maclean's user avatar
1 vote
1 answer
312 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 ...
loliki's user avatar
  • 151
1 vote
1 answer
555 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 {% ...
loliki's user avatar
  • 151
0 votes
1 answer
32 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 ...
Azazel's user avatar
  • 101
2 votes
2 answers
66 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"...
Wayne's user avatar
  • 21
1 vote
1 answer
1k 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 ...
asimkon's user avatar
  • 111
0 votes
1 answer
115 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 ...
biko's user avatar
  • 670
1 vote
1 answer
1k 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 ...
JBrew30's user avatar
  • 102
1 vote
1 answer
292 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') %} ...
Guido Neele's user avatar
1 vote
1 answer
594 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 ...
HendrikEng's user avatar
  • 1,064
1 vote
1 answer
77 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 ...
Karl Bishop's user avatar
2 votes
1 answer
2k 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 ...
artmem's user avatar
  • 1,022
1 vote
1 answer
237 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 ...
ChuckLean's user avatar
1 vote
0 answers
183 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 ...
TC0072's user avatar
  • 123
1 vote
2 answers
64 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 = { ...
weslawson's user avatar
1 vote
1 answer
209 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 ...
tfantina's user avatar
  • 125
2 votes
1 answer
147 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 ...
CreateSean's user avatar
  • 1,973
3 votes
2 answers
155 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('...
Dan Madoni's user avatar
1 vote
1 answer
438 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 ...
Kevon's user avatar
  • 160
1 vote
1 answer
430 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(...
Cole Henley's user avatar
  • 1,741
0 votes
0 answers
74 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-...
owenmelbz's user avatar
  • 149
1 vote
1 answer
477 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, ...
Sebastián.'s user avatar
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, ...
Danny Valle's user avatar
1 vote
1 answer
91 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'). ...
Matthias's user avatar
  • 110
0 votes
0 answers
226 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 ...
user3092's user avatar
  • 117

1
2 3 4 5
7