Skip to content

Commit

Permalink
Enclose search query with double quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
wwelling committed Apr 22, 2023
1 parent 0e1889e commit 817a2d5
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ protected static void addClassCountsToGroup(VClassGroup group, SearchEngine sear

SearchQuery query = searchEngine.createQuery().
setRows(0).
setQuery(VitroSearchTermNames.CLASSGROUP_URI + ":" + groupUri ).
setQuery(VitroSearchTermNames.CLASSGROUP_URI + ":\"" + groupUri + "\"").
addFacetFields( facetOnField ). //facet on type to get counts for classes in classgroup
setFacetMinCount(0);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ protected Map<String,Individual> getIndividualsForClass(String vclassURI, Webapp
if( VitroVocabulary.OWL_THING.equals( vclassURI )){
query.setQuery( "*:*" );
}else{
query.setQuery( VitroSearchTermNames.MOST_SPECIFIC_TYPE_URIS + ":" + vclassURI);
query.setQuery( VitroSearchTermNames.MOST_SPECIFIC_TYPE_URIS + ":\"" + vclassURI + "\"");
}
query.setStart(0)
.setRows(1000);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ private boolean tooManyRangeOptions(VitroRequest vreq, HttpSession session ) thr
if( VitroVocabulary.OWL_THING.equals( type )){
query.setQuery( "*:*" );
}else{
query.setQuery( VitroSearchTermNames.RDFTYPE + ":" + type);
query.setQuery( VitroSearchTermNames.RDFTYPE + ":\"" + type + "\"");
}
query.setRows(0);
SearchResponse rsp = searchEngine.query(query);
Expand Down Expand Up @@ -568,7 +568,7 @@ private Object rangeIndividualsExist(List<VClass> types) throws SearchEngineExce
for( VClass type:types){
//search for type count.
SearchQuery query = searchEngine.createQuery();
query.setQuery( VitroSearchTermNames.RDFTYPE + ":" + type.getURI());
query.setQuery( VitroSearchTermNames.RDFTYPE + ":\"" + type.getURI() + "\"");
query.setRows(0);

SearchResponse rsp = searchEngine.query(query);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ private boolean mightBeProfileRequest(String requestPath) {
*/
private String findEtagForIndividual(String individualUri) {
SearchEngine search = ApplicationUtils.instance().getSearchEngine();
SearchQuery query = search.createQuery("URI:" + individualUri).addFields(
SearchQuery query = search.createQuery("URI:\"" + individualUri + "\"").addFields(
ETAG_FIELD);

try {
Expand Down

0 comments on commit 817a2d5

Please sign in to comment.