본문 바로가기
개발/ALGOLIA

알고리아 Sending And Managing Data(2-2)

by dev_caleb 2022. 2. 28.
728x90

Setting Searchable Attributes

When you create an index, all attributes from all your records are searchable by default. Having all attributes searchable by default lets you perform searches right from the start without having to configure anything. Yet, if you want to make your search more relevant and remove the noise, you just want to set meaningful attributes as searchable. For example, if you’re building a cooking recipe website, you might include data such as image URLs which aren’t relevant for textual search.

You can do this by using the searchableAttributes setting, by specifying what attributes should be searchable. You can go a step further and rank your searchable attributes, making some more relevant than others.

index을 만들 때 기본적으로 모든 레코드의 모든 속성을 검색할 수 있습니다. 기본적으로 모든 특성을 검색할 수 있으므로 아무것도 구성할 필요 없이 처음부터 바로 검색을 수행할 수 있습니다. 그러나 검색을 보다 관련성 있게 만들고 노이즈를 제거하려면 의미 있는 속성을 검색 가능으로 설정해야 합니다. 예를 들어 요리법 웹사이트를 구축하는 경우 텍스트 검색과 관련이 없는 이미지 URL과 같은 데이터를 포함할 수 있습니다.
검색할 특성을 지정하여 searchableAttributes 설정을 사용하여 이 작업을 수행할 수 있습니다. 한 단계 더 나아가 검색 가능 속성의 순위를 매겨 일부 속성의 연관성을 높일 수 있습니다.

Dataset

Imagine you’re developing a website to find recipes. Here’s what the dataset could look like:

 

If you index this dataset without adding any setting, all attributes are searchable. Here, this means that when users search, the engine also searches into attributes like images, which you just need for display purposes.

For that reason, you want to explicitly set searchable attributes on what users would realistically search for. Here, it makes sense to make title, ingredients and comments searchable, and leave images out. Note that you can still display or filter attributes without making them searchable.

설정을 추가하지 않고 이 데이터 집합을 인덱싱하면 모든 특성을 검색할 수 있습니다. 즉, 사용자가 검색할 때 엔진이 이미지와 같은 속성도 검색하므로 표시 용도로만 필요합니다.
따라서 사용자가 실제로 검색할 항목에 대해 검색 가능한 속성을 명시적으로 설정할 수 있습니다. 여기서는 제목, 재료, 코멘트를 검색 가능하게 만들고 이미지를 생략하는 것이 타당하다. 검색 가능하도록 만들지 않고도 속성을 표시하거나 필터링할 수 있습니다.

 

 

Using the API(API 사용하기)

To make some attributes searchable, you need to use searchableAttributes during indexing time.

It’s important to note that when you set searchable attributes at the same level, they all have the same priority. In the example, this means that if you set title and comments at the same level and someone searches for cake, matches in the comments may come before matches in the recipe title.

Instead, you can order searchable attributes to define a priority.

몇 가지 속성을 검색가능하도록 만들기 위해서, indexing하는 시간동안 검색속성을 사용할 필요가 있다.

여기서 중요한 점은 검색 가능 특성을 동일한 수준으로 설정하면 우선 순위가 모두 동일하다는 것입니다. 예를 들어, 제목과 주석을 같은 수준으로 설정하고 다른 사용자가 케이크를 검색할 경우, 설명의 일치 항목이 레시피 제목의 일치 항목보다 먼저 나타날 수 있습니다.
대신 검색 가능한 특성의 순서를 지정하여 우선 순위를 정의할 수 있습니다.

Using the Algolia dashboard(알고리아 대시보드 사용하기)

You can also set your searchable attributes in your Algolia dashboard.

  1. Go to your dashboard and select your index.
  2. Click the Configuration tab.
  3. In the Searchable Attributes section, click the Add a Searchable Attribute button.
  4. You can change the level of importance of attributes by dragging them up or down on the page. To assign the same level of importance, when you create a new attribute, type them directly in the input field as a comma-separated list (for example, “title, comments”).
  5. Don’t forget to save your changes.

Algolia 대시보드에서 검색 가능한 속성을 설정할 수도 있습니다.
1. 대시보드로 이동하여 색인을 선택합니다.
2. Configuration 탭을 클릭합니다.
3. Searchable Attributes 섹션에서 Add a Searchable Attribute 버튼을 클릭합니다.
4. 페이지에서 특성을 위 또는 아래로 끌어서 중요도 수준을 변경할 수 있습니다. 동일한 중요도 수준을 할당하려면 새 속성을 작성할 때 입력 필드에 쉼표로 구분된 목록(예: "제목, 주석")으로 직접 입력합니다.
변경 사항을 저장하는 것을 잊지 마십시오.

 
 

 

728x90