All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.honhimw.ms.api.SearchableAttributesSettings Maven / Gradle / Ivy

/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package io.github.honhimw.ms.api;

import io.github.honhimw.ms.model.TaskInfo;
import io.swagger.v3.oas.annotations.Operation;

import java.util.List;

/**
 * 

Searchable attributes

* The values associated with attributes in the searchableAttributes list are searched for matching query words. The order of the list also determines the attribute ranking order. *

* By default, the searchableAttributes array is equal to all fields in your dataset. This behavior is represented by the value ["*"]. *

WARNING

*
 * Updating searchable attributes will re-index all documents in the index, which can take some time. We recommend updating your index settings first and then adding documents as this reduces RAM consumption.
 * 
* * To learn more about searchable attributes, refer to our dedicated guide. * * * @author hon_him * @since 2024-01-03 */ public interface SearchableAttributesSettings { /** * Get the searchable attributes of an index. * * @return current index searchable attributes */ @Operation(method = "GET", tags = "/indexes/{index_uid}/settings/searchable-attributes") List get(); /** * Update the searchable attributes of an index. *

WARNING

*
     * Due to an implementation bug, manually updating searchableAttributes will change the displayed order of document fields in the JSON response. This behavior is inconsistent and will be fixed in a future release.
     * 
* * @param searchableAttributes An array of strings. * Each string should be an attribute that exists in the selected index. * The array should be given in order of importance: from the most important attribute to the least important attribute. * If an attribute contains an object, * you can use dot notation to set one or more of its keys as a value for this setting: * "searchableAttributes": ["release_date.year"]. *

WARNING

*
     *                                                         If the field does not exist, no error will be thrown.
     *                                                         
* @return update task */ @Operation(method = "PUT", tags = "/indexes/{index_uid}/settings/searchable-attributes") TaskInfo update(List searchableAttributes); /** * Reset the searchable attributes of the index to the default value. * * @return reset task */ @Operation(method = "DELETE", tags = "/indexes/{index_uid}/settings/searchable-attributes") TaskInfo reset(); }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy