Skip to content

Commit

Permalink
inital changes for knife indexing
Browse files Browse the repository at this point in the history
Signed-off-by: talktovikas <[email protected]>
  • Loading branch information
talktovikas committed Dec 2, 2024
1 parent 948ceb8 commit 0c3ebd4
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@
{timeout, <%= @solr_timeout %>},
{init_count, <%= @solr_http_init_count %>},
{max_count, <%= @solr_http_max_count %>},
{track_total_hits,true},
{cull_interval, <%= @solr_http_cull_interval %>},
{max_age, <%= @solr_http_max_age %>},
{max_connection_duration, <%= @solr_http_max_connection_duration %>},
Expand Down
1 change: 1 addition & 0 deletions src/oc_erchef/apps/chef_index/src/chef_index_query.erl
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ from_params(Provider, ObjType, QueryString, Start, Rows) ->
search_provider = Provider,
start = decode({nonneg_int, "start"}, Start, 0),
rows = decode({nonneg_int, "rows"}, Rows, 1000),
track_total_hits = envy:get(chef_index, track_total_hits, false, boolean),
sort = "X_CHEF_id_CHEF_X asc",
index = index_type(ObjType)}.

Expand Down
2 changes: 2 additions & 0 deletions src/oc_erchef/apps/chef_index/src/chef_opensearch.erl
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ query_body(#chef_solr_query{
query_string = Query,
filter_query = undefined,
start = Start,
track_total_hits = TrackTotalHits,
rows = Rows}) ->
jiffy:encode({[{fields_tag(), <<"_id">>},
{<<"from">>, Start},
Expand All @@ -118,6 +119,7 @@ query_body(#chef_solr_query{
jiffy:encode({[{ fields_tag(), <<"_id">>},
{<<"from">>, Start},
{<<"size">>, Rows},
{<<"track_total_hits">>,TrackTotalHits},
{<<"sort">>, [{[{<<"X_CHEF_id_CHEF_X">>, {[{<<"order">>, <<"asc">>}]}}]}]},
{<<"query">>, {[
{<<"bool">>,{[
Expand Down
1 change: 1 addition & 0 deletions src/oc_erchef/habitat/config/sys.config
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@
{search_batch_max_wait, 10},
{reindex_sleep_min_ms, 500},
{reindex_sleep_max_ms, 2000},
{track_total_hits,true},
{reindex_item_retries, 3},
{solr_elasticsearch_major_version, 5},
{solr_service, [
Expand Down
1 change: 1 addition & 0 deletions src/oc_erchef/include/chef_solr.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
search_provider = solr :: 'solr' | 'elasticsearch' | 'opensearch',
start :: integer() | undefined,
rows :: integer() | undefined,
track_total_hits :: boolean(),
sort :: string() | undefined,
index :: 'node'
| 'role'
Expand Down

0 comments on commit 0c3ebd4

Please sign in to comment.