summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-05-18 03:01:55 +0000
committerCoprDistGit <infra@openeuler.org>2023-05-18 03:01:55 +0000
commit2c6a2c442a6921fddf811f3a27fc970ed4bd262d (patch)
tree1e39ff8272929c54b94395c43e6d3ea7ed675465
parent71fbcae355c18b2f725127c0710967f7cedc9139 (diff)
automatic import of python-ckanext-search-tweaks
-rw-r--r--.gitignore1
-rw-r--r--python-ckanext-search-tweaks.spec191
-rw-r--r--sources1
3 files changed, 193 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..5f8a754 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/ckanext-search-tweaks-0.4.12.tar.gz
diff --git a/python-ckanext-search-tweaks.spec b/python-ckanext-search-tweaks.spec
new file mode 100644
index 0000000..47eecf7
--- /dev/null
+++ b/python-ckanext-search-tweaks.spec
@@ -0,0 +1,191 @@
+%global _empty_manifest_terminate_build 0
+Name: python-ckanext-search-tweaks
+Version: 0.4.12
+Release: 1
+Summary: please add a summary manually as the author left a blank one
+License: AGPL
+URL: https://github.com/DataShades/ckanext-search-tweaks
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/07/54/56298903676bddcc225126efcb6457c0b885a181a62f515d6a28fec5f769/ckanext-search-tweaks-0.4.12.tar.gz
+BuildArch: noarch
+
+Requires: python3-freezegun
+Requires: python3-typing-extensions
+
+%description
+### <a id="search_tweaks_query_relevance"></a> search_tweaks_query_relevance
+Increase relevance of datasets for particular query depending on number of
+direct visits of the dataset after running this search. I.e, if user searches
+for `something` and then visits dataset **B** which is initially displayed in a
+third row of search results, eventually this dataset will be displayed on the
+second or even on the first row. This is implemented in three stages. On the
+first stage, statistics collected and stored inside storage(redis, by default)
+and then this statistics converted into numeric solr field via cronjob.
+Finally, Solr's boost function that scales number of visits and improves score
+for the given query is applied during search.
+Following steps are required in order to configure this plugin:
+- Add field that will store statistics to schema.xml(`query_relevance_` prefix
+ can be changed via config option):
+ <dynamicField name="query_relevance_*" type="int" indexed="true" stored="true"/>
+- Configure a cronjob which will update search-index periodically:
+ 0 0 * * * ckan search-index rebuild
+#### CLI
+ relevance query align - remove old data from storage. Actual result of this command depends
+ on storage backend, that is controlled by config. At the momment, only `redis-daily` backend
+ is affected by this command - all records older than `query_relevance.daily.age` days are removed.
+ relevance query export - export statistics as CSV.
+ relevance query import - import statistics from CSV. Note, records that are already in storage but
+ are not listed in CSV won't be removed. It must be done manually
+#### Config settings
+ # Which backend to use in order to collect information about dataset
+ # relevance for the particular search query. Possible values are:
+ # "redis-permanent", "redis-daily"
+ # (optional, default: redis-daily).
+ ckanext.search_tweaks.query_relevance.backend = redis-permanent
+ # How long(in days) information about dataset visits will be stored in order to
+ # update relevance of dataset in search query.
+ # (optional, default: 90).
+ ckanext.search_tweaks.query_relevance.daily.age = 90
+ # Solr boost function with $field placeholder that will be replaced by
+ # the correspoinding field name
+ # (optional, default: "scale(def($field,0),1,1.2)").
+ ckanext.search_tweaks.query_relevance.boost_function = recip($field,1,1000,1000)
+ # Prefix of the numeric field defined in Solr schema. This field will hold
+ # dataset's relevance for the given query.
+ # (optional, default: query_relevance_).
+
+%package -n python3-ckanext-search-tweaks
+Summary: please add a summary manually as the author left a blank one
+Provides: python-ckanext-search-tweaks
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-ckanext-search-tweaks
+### <a id="search_tweaks_query_relevance"></a> search_tweaks_query_relevance
+Increase relevance of datasets for particular query depending on number of
+direct visits of the dataset after running this search. I.e, if user searches
+for `something` and then visits dataset **B** which is initially displayed in a
+third row of search results, eventually this dataset will be displayed on the
+second or even on the first row. This is implemented in three stages. On the
+first stage, statistics collected and stored inside storage(redis, by default)
+and then this statistics converted into numeric solr field via cronjob.
+Finally, Solr's boost function that scales number of visits and improves score
+for the given query is applied during search.
+Following steps are required in order to configure this plugin:
+- Add field that will store statistics to schema.xml(`query_relevance_` prefix
+ can be changed via config option):
+ <dynamicField name="query_relevance_*" type="int" indexed="true" stored="true"/>
+- Configure a cronjob which will update search-index periodically:
+ 0 0 * * * ckan search-index rebuild
+#### CLI
+ relevance query align - remove old data from storage. Actual result of this command depends
+ on storage backend, that is controlled by config. At the momment, only `redis-daily` backend
+ is affected by this command - all records older than `query_relevance.daily.age` days are removed.
+ relevance query export - export statistics as CSV.
+ relevance query import - import statistics from CSV. Note, records that are already in storage but
+ are not listed in CSV won't be removed. It must be done manually
+#### Config settings
+ # Which backend to use in order to collect information about dataset
+ # relevance for the particular search query. Possible values are:
+ # "redis-permanent", "redis-daily"
+ # (optional, default: redis-daily).
+ ckanext.search_tweaks.query_relevance.backend = redis-permanent
+ # How long(in days) information about dataset visits will be stored in order to
+ # update relevance of dataset in search query.
+ # (optional, default: 90).
+ ckanext.search_tweaks.query_relevance.daily.age = 90
+ # Solr boost function with $field placeholder that will be replaced by
+ # the correspoinding field name
+ # (optional, default: "scale(def($field,0),1,1.2)").
+ ckanext.search_tweaks.query_relevance.boost_function = recip($field,1,1000,1000)
+ # Prefix of the numeric field defined in Solr schema. This field will hold
+ # dataset's relevance for the given query.
+ # (optional, default: query_relevance_).
+
+%package help
+Summary: Development documents and examples for ckanext-search-tweaks
+Provides: python3-ckanext-search-tweaks-doc
+%description help
+### <a id="search_tweaks_query_relevance"></a> search_tweaks_query_relevance
+Increase relevance of datasets for particular query depending on number of
+direct visits of the dataset after running this search. I.e, if user searches
+for `something` and then visits dataset **B** which is initially displayed in a
+third row of search results, eventually this dataset will be displayed on the
+second or even on the first row. This is implemented in three stages. On the
+first stage, statistics collected and stored inside storage(redis, by default)
+and then this statistics converted into numeric solr field via cronjob.
+Finally, Solr's boost function that scales number of visits and improves score
+for the given query is applied during search.
+Following steps are required in order to configure this plugin:
+- Add field that will store statistics to schema.xml(`query_relevance_` prefix
+ can be changed via config option):
+ <dynamicField name="query_relevance_*" type="int" indexed="true" stored="true"/>
+- Configure a cronjob which will update search-index periodically:
+ 0 0 * * * ckan search-index rebuild
+#### CLI
+ relevance query align - remove old data from storage. Actual result of this command depends
+ on storage backend, that is controlled by config. At the momment, only `redis-daily` backend
+ is affected by this command - all records older than `query_relevance.daily.age` days are removed.
+ relevance query export - export statistics as CSV.
+ relevance query import - import statistics from CSV. Note, records that are already in storage but
+ are not listed in CSV won't be removed. It must be done manually
+#### Config settings
+ # Which backend to use in order to collect information about dataset
+ # relevance for the particular search query. Possible values are:
+ # "redis-permanent", "redis-daily"
+ # (optional, default: redis-daily).
+ ckanext.search_tweaks.query_relevance.backend = redis-permanent
+ # How long(in days) information about dataset visits will be stored in order to
+ # update relevance of dataset in search query.
+ # (optional, default: 90).
+ ckanext.search_tweaks.query_relevance.daily.age = 90
+ # Solr boost function with $field placeholder that will be replaced by
+ # the correspoinding field name
+ # (optional, default: "scale(def($field,0),1,1.2)").
+ ckanext.search_tweaks.query_relevance.boost_function = recip($field,1,1000,1000)
+ # Prefix of the numeric field defined in Solr schema. This field will hold
+ # dataset's relevance for the given query.
+ # (optional, default: query_relevance_).
+
+%prep
+%autosetup -n ckanext-search-tweaks-0.4.12
+
+%build
+%py3_build
+
+%install
+%py3_install
+install -d -m755 %{buildroot}/%{_pkgdocdir}
+if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
+if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
+if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
+if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
+pushd %{buildroot}
+if [ -d usr/lib ]; then
+ find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/lib64 ]; then
+ find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/bin ]; then
+ find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/sbin ]; then
+ find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+touch doclist.lst
+if [ -d usr/share/man ]; then
+ find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
+fi
+popd
+mv %{buildroot}/filelist.lst .
+mv %{buildroot}/doclist.lst .
+
+%files -n python3-ckanext-search-tweaks -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Thu May 18 2023 Python_Bot <Python_Bot@openeuler.org> - 0.4.12-1
+- Package Spec generated
diff --git a/sources b/sources
new file mode 100644
index 0000000..082b8d0
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+1fcd2cbe4df4f5b917d4de1410b8c6b4 ckanext-search-tweaks-0.4.12.tar.gz