Help on lucene queries

I’m working on LUI-123 - Capability of searching concepts by Concept UUIDs .

While looking for a fix. I stumbled upon the following query which is for searching concepts by a given keyword. keyword can be a concept name (eg: Sulfonamides) or a concept id (eg: 162170)

(concept.conceptMappings.conceptReferenceTerm.code:(keyword)^0.4 OR (( name:(“keyword”)^0.7 OR ( (name:(keyword)^0.6 OR name:(keyword*)^0.3 OR name:(keyword~0.8)^0.1))^0.3) localePreferred:true)^0.4 OR (( name:(“keyword”)^0.7 OR ( (name:(keyword)^0.6 OR name:(keyword*)^0.3 OR name:(keyword~0.8)^0.1))^0.3))^0.2) locale:(en* ) voided:false

But the problem is that this query works for only concept names and ids. If I pass uuid as the keyword, the query.resultSize() returns 0. What changes can I made so that it works with uuids as well?

This query belongs in here : org.openmrs.api.db.hibernate.HibernateConceptDAO#getCountOfConcepts:1430

Try modifying the query like so: “(concept.uuid:(“keyword”) OR concept.conceptMappings.conceptReferenceTerm.code:(keyword)^0.4 …”, but first make sure uuid is indexed by adding @Field(analyze = Analyze.NO) on the uuid field in BaseOpenmrsObject.