Skip to main content

Types of Keyword Search in Kuroco

Kuroco offers three different types of keyword search functions, each with its own features and use cases. This reference explains the characteristics, specifications, and usage patterns of each type.

Overview of Search Types

Search TypeDescriptionUse Cases
topics_keywordAutomatically searches each item without special settingsQuick implementation of basic keyword searches
full_text_searchSearches strings generated from templates with high performanceAdvanced search using custom search content across multiple columns
Filter SearchUses filter queries with complex conditionsAdvanced search using multiple conditions and operators

topics_keyword

The topics_keyword search automatically searches each item within the content.

Features

  • Automatically searches each item within the content
  • Space-separated keywords default to performing an AND search
  • Option to change AND search to OR search with parameters
  • Case-insensitive for alphanumeric characters (from the April official version)
  • Ability to specify columns to search
  • Easy to implement with minimal configuration

Searchable Item Types

topics_keyword automatically searches the following item types:

Standard Fields:

  • subject - Title/subject field of the content
  • contents - Text field of the main content
  • topics_id - Content ID (if the keyword is numeric)
  • slug - Content's Slug
  • contents_type - Content type/category (search by category name)

Extended Column Types:

  • Text
  • Text (Autocomplete)
  • Text Area
  • WYSIWYG
  • HTML
  • Single Selection: search by both key and label
  • Multiple Selection: search by both key and label
  • Date Format
  • Master Format: search by both key and label
  • Master (Checkbox): search by both key and label
  • Related Information Selection: search using module_id, module_type
  • Boolean Field: search true/false as strings
  • Image (uploaded to KurocoFiles): search by desc
  • File (uploaded to KurocoFiles): search by desc
  • File (from File Manager): search by file path
  • API Field
  • Counter: search as strings
  • Link: search by url, title
  • Number: search as strings
  • Table
  • Map: search by gmap_x, gmap_y, gmap_type, gmap_zoom (gmap_place_id unconfirmed)
  • Block Editor: search by html, type, text, textAlign, etc.
tip

Use the target_col_for_keyword parameter to restrict the search to specific fields.

Parameters

ParameterTypeDescriptionDefault
topics_keywordstringKeyword to search-
topics_keyword_condstringCondition for multiple keywords: "AND" or "OR""AND"
target_col_for_keywordstring/arrayColumns to search (e.g., "subject", "contents", "ext_1")
*Cannot set for boolean values
All searchable columns
use_target_col_for_keyword_from_requestbooleanAllow specifying target_col_for_keyword in the queryfalse

Multilingual Support

  • To search in a secondary language, use the _lang parameter (e.g. ?_lang=en)
  • The search will automatically function in the specified language

Example of Use

/rcms-api/1/content?topics_keyword=example&topics_keyword_cond=OR

Notes

  • The implementation is simple but does not support complex conditions
  • For more advanced searches, consider using Filter Search

full_text_search generates a searchable text string using a template, providing high-performance search across multiple columns.

Features

  • Search generated strings from templates
  • High performance for searching across multiple columns
  • By default, space-separated keywords perform an AND search
  • Change from AND to OR search using a parameter
  • Keyword template setting required in content definition
  • Can include related content and member information in the search text

Parameters

ParameterTypeDescriptionDefault
full_text_searchstringKeyword to search-
full_text_search_condstringCondition for multiple keywords: "AND" or "OR""AND"

Multilingual Support

  • To search in a secondary language, use the _lang parameter (e.g. ?_lang=en)
  • The search will automatically function in the specified language

Template Setting

The following settings are required to use full_text_search.

  1. Enable "Use a template for keyword search" in content definition settings
  2. Set up a template using Smarty syntax

Example of Use

/rcms-api/1/content?full_text_search=example&full_text_search_cond=AND

Notes

Filter Search executes complex searches based on various conditions and operators using the filter query feature.

Features

  • Using the contains operator in filter queries allows for partial matching searches on specified items (keyword search)
  • Using the search_keyword parameter in filter queries allows for searches across multiple items
  • Supports complex search conditions with multiple operators
  • Can be combined with other filter conditions using AND/OR
  • Provides options for case-sensitive and case-insensitive searches
  • Searchable across specific columns

Fields Searchable with contains

The following columns can be searched for partial string matches using contains, icontains, ncontains, nicontains in Filter Search:

Standard Fields:

  • subject - Title/subject field of the content
  • slug - Slug of the content
  • contents - Text field of the main content

Extended Column Types:

  • Text
  • Text (Autocomplete)
  • Text Area
  • WYSIWYG
  • HTML
  • Single Selection: search for key
  • Multiple Selection: search for key
  • Date Format
  • Master Format: search for key
  • Master (Checkbox): search for key
  • Boolean Field: search for true/false as strings
  • Image (Uploaded to KurocoFiles): search using desc
  • File (Uploaded to KurocoFiles): search using desc
  • File (From File Manager): search for file path
  • API Field
  • Link: search for both url and title
  • Table
  • Map: search for gmap_x, gmap_y, gmap_type, gmap_zoom (gmap_place_id is unconfirmed)
  • Block Editor: search using html, type, text, textAlign, etc.
info

Items to be targeted for Filter search must be allowed in the filter_request_allow_list parameter of the endpoint.

note

If incomplete tags are included in the search string, the search may not be possible due to security measures.

Multiple Item Search by search_keyword

By specifying in the form of search_keyword contains "KEYWORD", you can narrow down the search using contains for multiple contents specified in advance.
Items are specified in filter_request_allow_list as search_keyword:[subject,ext_1].

Multilanguage Support

  • To search in a secondary language, use the filter_lang parameter (e.g., ?filter_lang=en)
  • In filter search, you can separately set the language to be searched (filter_lang) and the language of the response (_lang)

Examples

Keyword search for a specific item:

?filter=ext_1 contains "example"

Keyword search for multiple items specified:

?filter=ext_1 contains "example" OR ext_2 contains "example2"

Case-insensitive search:

?filter=ext_1 icontains "example"

Not search:

?filter=ext_1 ncontains "exclude word"

Combination with other conditions:

?filter=ext_1 contains "example" AND inst_ymdhi > "2023-01-01"

Multiple item search by search_keyword:

// Set filter_request_allow_list keyword:[subject,ext_1] on the endpoint in advance
?filter=search_keyword contains "example"

Notes


Support

If you have any other questions, please contact us or check out Our Slack Community.