Skip to content

Commit

Permalink
Revert "Honor the solr q.op param" -- it breaks rolling upgrade
Browse files Browse the repository at this point in the history
This reverts commit 2a12ea8.
  • Loading branch information
rzezeski committed Sep 26, 2011
1 parent 5fb0188 commit 67ca6ef
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 17 deletions.
1 change: 0 additions & 1 deletion include/riak_search.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
parent=undefined,
index=undefined,
field=undefined,
default_op,
num_terms=0,
num_docs=0,
query_norm=0,
Expand Down
3 changes: 1 addition & 2 deletions src/riak_search_client.erl
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,11 @@ parse_query(IndexOrSchema, Query) ->
{ok, Schema} = riak_search_config:get_schema(IndexOrSchema),
DefaultIndex = Schema:name(),
DefaultField = Schema:default_field(),
DefaultOp = Schema:default_op(),
{ok, Ops} = lucene_parser:parse(
riak_search_utils:to_list(DefaultIndex),
riak_search_utils:to_list(DefaultField),
riak_search_utils:to_list(Query)),
{ok, riak_search_op:preplan(Ops, #search_state{default_op=DefaultOp})}.
{ok, riak_search_op:preplan(Ops)}.

%% Parse the provided filter. Returns either {ok, FilterOps} or {error,
%% Error}.
Expand Down
9 changes: 1 addition & 8 deletions src/riak_search_op_group.erl
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,7 @@ preplan(Op, State) ->
%% appropriately.
Index = State#search_state.index,
{ok, Schema} = riak_search_config:get_schema(Index),
DefaultOp =
case State#search_state.default_op of
undefined ->
Schema:default_op();
Else ->
Else
end,
case DefaultOp of
case Schema:default_op() of
'and' ->
NewOp = #intersection { id=Op#group.id, ops=OpList };
'or' ->
Expand Down
7 changes: 1 addition & 6 deletions src/riak_solr_searcher_wm.erl
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,7 @@ parse_squery(Req) ->
false ->
Filter = wrq:get_qs_value("filter", "", Req),
DefaultField = wrq:get_qs_value("df", undefined, Req),
DefaultOp = case wrq:get_qs_value("q.op", undefined, Req) of
undefined ->
undefined;
Other ->
to_atom(string:to_lower(Other))
end,
DefaultOp = to_atom(wrq:get_qs_value("q.op", undefined, Req)),
QueryStart = to_integer(wrq:get_qs_value("start", 0, Req)),
QueryRows = to_integer(wrq:get_qs_value("rows", ?DEFAULT_RESULT_SIZE, Req)),
SQuery = #squery{q=Query,
Expand Down

0 comments on commit 67ca6ef

Please sign in to comment.