Skip to main content
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
ChitraMadan
ChitraMadanAccepted solution
Community Advisor
September 12, 2020

Hi @binoyp,

 

Full text search will be able to find español in the content irrespective of language. Please see below OOTB groovy script which is able to find all the references of español in the content

 

def predicates = [
"path": "/content",
"fulltext": "español"
]

def query = createQuery(predicates)

query.hitsPerPage = 10

def result = query.result

println "${result.totalMatches} hits, execution time = ${result.executionTime}s\n--"

result.hits.each { hit ->
println "hit path = ${hit.node.path}"
}

 

Please check if UTF-8 is enabled in Apache Sling Request Parameter Handling configuration.

9 replies

Singaiah_Chintalapudi
Level 7
September 12, 2020

The QueryBuilder works on the given predicates. If you're using non-english words and searching in those specific locales, it should work. For example: searching "español" in /content/yourproject/es/*.

 

What problem are you facing or whats the requirement?

 

Thanks,

Singaiah

Translate
binoypAuthor
Level 2
September 13, 2020
Hi Singaiah, the exact doubt is that when i try passing the fulltext as a parameter in a querybuilder servlet for searching the pages. These special characters throw a bad request error . How can we work around this.
Translate
ChitraMadan
Community Advisor
ChitraMadanCommunity AdvisorAccepted solution
Community Advisor
September 12, 2020

Hi @binoyp,

 

Full text search will be able to find español in the content irrespective of language. Please see below OOTB groovy script which is able to find all the references of español in the content

 

def predicates = [
"path": "/content",
"fulltext": "español"
]

def query = createQuery(predicates)

query.hitsPerPage = 10

def result = query.result

println "${result.totalMatches} hits, execution time = ${result.executionTime}s\n--"

result.hits.each { hit ->
println "hit path = ${hit.node.path}"
}

 

Please check if UTF-8 is enabled in Apache Sling Request Parameter Handling configuration.

Translate
binoypAuthor
Level 2
September 13, 2020
Hi Chitra, the exact doubt is that when i try passing the fulltext as a parameter in a querybuilder servlet for searching the pages. These special characters throw a bad request error . How can we work around this.
Translate