<commit_before>%% -*- erlang-indent-level: 4;indent-tabs-mode: nil; fill-column: 92-*-
%% ex: ts=4 sw=4 et
%% @author <NAME> <<EMAIL>>
%% @author <NAME> <<EMAIL>>
%% @author <NAME> <<EMAIL>>
%% @author <NAME> <<EMAIL>>
%% @author <NAME> <<EMAIL>>
%% @author <NAME> <<EMAIL>>
%% Copyright 2012 Opscode, Inc. All Rights Reserved.
%%
%% This file is provided to you 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.
%%


-module(chef_wm_search).

-include("chef_wm.hrl").
-include_lib("chef_index/include/chef_solr.hrl").

-define(DEFAULT_BATCH_SIZE, 5).
-define(LOG_DIFF_TUPLE(Solr1, Solr4, Query, OrgName), {{'query', Query},
                {orgname, OrgName},
                {solr1, Solr1},
                {solr4, Solr4}}).

%% We chose to *not* mixin chef_wm_base:post_is_create/2 as a POST in
%% this resource is purely for processing...not resource creation.
-mixin([{chef_wm_base, [content_types_accepted/2,
                        content_types_provided/2,
                        finish_request/2,
                        malformed_request/2,
                        ping/2]}]).

-mixin([{?BASE_RESOURCE, [forbidden/2,
                          is_authorized/2,
                          service_available/2]}]).

%% I think we will end up moving the generic complete wm callbacks like post_is_create,
%% content_types_* into chef_wm_base and mixing those in here separately so that we only
%% have to have those defined in one place.

%% chef_wm behavior callbacks
-behaviour(chef_wm).
-export([auth_info/2,<commit_msg>Remove unused macro<commit_after>%% -*- erlang-indent-level: 4;indent-tabs-mode: nil; fill-column: 92-*-
%% ex: ts=4 sw=4 et
%% @author <NAME> <<EMAIL>>
%% @author <NAME> <<EMAIL>>
%% @author <NAME> <<EMAIL>>
%% @author <NAME> <<EMAIL>>
%% @author <NAME> <<EMAIL>>
%% @author <NAME> <<EMAIL>>
%% Copyright 2012 Opscode, Inc. All Rights Reserved.
%%
%% This file is provided to you 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.
%%


-module(chef_wm_search).

-include("chef_wm.hrl").
-include_lib("chef_index/include/chef_solr.hrl").

-define(DEFAULT_BATCH_SIZE, 5).

%% We chose to *not* mixin chef_wm_base:post_is_create/2 as a POST in
%% this resource is purely for processing...not resource creation.
-mixin([{chef_wm_base, [content_types_accepted/2,
                        content_types_provided/2,
                        finish_request/2,
                        malformed_request/2,
                        ping/2]}]).

-mixin([{?BASE_RESOURCE, [forbidden/2,
                          is_authorized/2,
                          service_available/2]}]).

%% I think we will end up moving the generic complete wm callbacks like post_is_create,
%% content_types_* into chef_wm_base and mixing those in here separately so that we only
%% have to have those defined in one place.

%% chef_wm behavior callbacks
-behaviour(chef_wm).
-export([auth_info/2,
{'fraction_non_alphanumeric': 0.12734756881914072, 'fraction_numerical': 0.01389246205299717, 'mean_word_length': 3.1405750798722045, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7520876', 'n_tokens_mistral': 1213, 'n_tokens_neox': 1174, 'n_words': 395}