Skip to content

Update SearchWithBoostSpec.java #10096

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

package search;

// [START retail_search_simple_query]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The region tag retail_search_simple_query has been added here. This file, SearchWithBoostSpec.java, demonstrates search functionality that includes BoostSpec (boost specifications), which is a somewhat more advanced feature than what might be implied by "simple query".

Considering there's another file, SearchSimpleQuery.java, in the same package that appears to demonstrate a search without these boost specifications, could you clarify the rationale for placing the retail_search_simple_query tag in this particular file?

To enhance clarity for users looking for specific examples, would it be more appropriate to:

  1. Place the retail_search_simple_query tag in the SearchSimpleQuery.java file instead, as it seems to represent a more basic query example?
  2. Or, use a more descriptive tag for this file, such as retail_search_with_boost_spec, to accurately reflect its content?

This will help ensure that the region tags accurately guide users to the examples that best suit their needs.


import com.google.cloud.ServiceOptions;
import com.google.cloud.retail.v2.SearchRequest;
import com.google.cloud.retail.v2.SearchRequest.BoostSpec;
Expand Down Expand Up @@ -79,3 +81,5 @@ public static void searchResponse(String defaultSearchPlacementName) throws IOEx
}
}
}

// [END retail_search_simple_query]