Skip to content

Commit

Permalink
chore: minor solr changes
Browse files Browse the repository at this point in the history
Signed-off-by: Oleh Astappiev <[email protected]>
  • Loading branch information
astappiev committed Aug 12, 2024
1 parent a16c058 commit 94cfe1e
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 66 deletions.
52 changes: 26 additions & 26 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

76 changes: 36 additions & 40 deletions src/main/conf/solr-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,21 +60,27 @@ else

echo "adding schema fields"
curl -X POST -H 'Content-type:application/json' --data-binary '{
"add-field":[
{
"name": "author",
"add-field":[
{
"name": "title",
"type": "text_general",
"multiValued": false
},
{
"name": "comments",
"type": "text_general"
"name": "author",
"type": "text_general",
"multiValued": false
},
{
"name": "description",
"type": "text_general",
"multiValued": false
},
{
"name": "machineDescription",
"type": "text_general",
"multiValued": false
},
{
"name": "format",
"type": "string"
Expand All @@ -91,11 +97,6 @@ else
"name": "location",
"type": "string"
},
{
"name": "machineDescription",
"type": "text_general",
"multiValued": false
},
{
"name": "ownerUserId",
"type": "pint"
Expand All @@ -108,63 +109,58 @@ else
"name": "source",
"type": "string"
},
{
"name": "tags",
"type": "text_general"
},
{
"name": "text",
"type": "text_general",
"multiValued": true,
"indexed": true,
"stored": false
},
{
"name": "timestamp",
"type": "pdate"
},
{
"name": "title",
"type": "text_general",
"multiValued": false
},
{
"name": "type",
"type": "string"
},
{
"name": "url",
"type": "string"
},
{
"name": "tags",
"type": "text_general"
},
{
"name": "comments",
"type": "text_general"
},
{
"name": "fulltext",
"type": "text_general",
"multiValued": true,
"indexed": true,
"stored": false
}
],
"add-copy-field":[
{
],
"add-copy-field":[
{
"source": "author",
"dest": "text"
"dest": ["fulltext", "author_s"]
},
{
"source": "comments",
"dest": "text"
"dest": "fulltext"
},
{
"source": "description",
"dest": "text"
"dest": "fulltext"
},
{
"source": "machineDescription",
"dest": "text"
"dest": "fulltext"
},
{
"source": "tags",
"dest": "text"
"dest": "fulltext"
},
{
"source": "title",
"dest": "text"
},
{
"source": "author",
"dest": "author_s"
"dest": "fulltext"
},
{
"source": "tags",
Expand All @@ -174,7 +170,7 @@ else
"source": "*",
"dest": "_text_"
}
]
]
}' http://$solr_host/solr/$core_name/schema

echo "finished configuring with the Schema API"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ public void setFacetQueries(String... facetQueries) {
private QueryResponse getQueryResourcesByPage(int page) throws IOException {
SolrQuery solrQuery = new SolrQuery(query);
solrQuery.set("qt", "/LearnwebQuery");
solrQuery.set("mm", "-30%");

if (filterGroupIds != null && !filterGroupIds.isEmpty()) {
solrQuery.addFilterQuery("groupId : (" + StringUtils.join(filterGroupIds, " OR ") + ")");
Expand Down

0 comments on commit 94cfe1e

Please sign in to comment.