• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

openmrs / openmrs-core / 14752386992

30 Apr 2025 10:25AM UTC coverage: 64.96% (-0.1%) from 65.095%
14752386992

push

github

web-flow
TRUNK-6316 Upgrade Hibernate Search to 6.2.4 (#5005)

501 of 591 new or added lines in 24 files covered. (84.77%)

21 existing lines in 6 files now uncovered.

23344 of 35936 relevant lines covered (64.96%)

0.65 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/api/src/main/java/org/openmrs/api/db/hibernate/search/SearchQueryUtils.java
1
/**
2
 * This Source Code Form is subject to the terms of the Mozilla Public License,
3
 * v. 2.0. If a copy of the MPL was not distributed with this file, You can
4
 * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
5
 * the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
6
 *
7
 * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
8
 * graphic logo is a trademark of OpenMRS Inc.
9
 */
10
package org.openmrs.api.db.hibernate.search;
11

12
/**
13
 * Provides utils for working with queries in Hibernate Search
14
 * 
15
 * @since 2.8.0
16
 */
17
public class SearchQueryUtils {
18
        
19
        private SearchQueryUtils() {
20
        }
21
        
22
        /**
23
         * Escapes special characters such as: <code>()*-+|~"</code>
24
         * 
25
         * @param query the query
26
         * @return escaped query
27
         */
28
        public static String escapeQuery(String query) {
NEW
29
                return query.replace("(", "\\(").replace(")", "\\)".replace("+", "\\+")).replace("-", "\\-").replace("|", "\\|")
×
NEW
30
                        .replace("*", "\\*").replace("~", "\\~").replace("\"", "\\\"");
×
31
        }
32
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc