If lucene queries are not working in 1.11.1, how do I fix it?

6 views
Skip to first unread message

Darius Jazayeri

unread,
Apr 6, 2015, 2:08:41 PM4/6/15
to dev
Hi All,

I trying to test a build of the standalone for OpenMRS 2.2, and I hit a problem with searching for concepts in the local install.

I need some guidance about how to bootstrap lucene (or how else to debug this).

In the UI if I go to the 1.x concept screens, and search for "no" it finds nothing.

Debugging (attaching intellij to that tomcat as remote), I put a breakpoint in org.openmrs.api.db.hibernate.HibernateConceptDAO#getCountOfConcepts and I see the following query:

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

This return a resultSize() of 0.

However if I look in the db, or just do conceptService.getConcept(2) the concept for no is there, with a name in the correct local.

Could the problem be that lucene indices aren't built? How might that have happened? What would I need to do to research this or fix it? (I know virtually nothing about the specifics of how concept searching was redone in 1.11+.)

-Darius

Rafal Korytkowski

unread,
Apr 6, 2015, 4:05:54 PM4/6/15
to Developers List
To check if the issue is that the index hasn't been built, clear or delete search.indexVersion and restart standalone. The entire Lucene index should be rebuilt.


-Rafał

--
OpenMRS Developers: http://om.rs/dev
Post: d...@openmrs.org | Unsubscribe: dev+uns...@openmrs.org
Manage your OpenMRS subscriptions: http://om.rs/id
 
*** ALERT! This group will be moved to OpenMRS Talk effective 10 April 2015 at 19:00 UTC. Please visit https://talk.openmrs.org/t/openmrs-developers-group-changes-2015-04-10/1508 for details and to make necessary changes.

Rafal Korytkowski

unread,
Apr 6, 2015, 4:06:56 PM4/6/15
to Developers List
I meant the search.indexVersion global property.


-Rafał

On 6 April 2015 at 20:08, Darius Jazayeri <djaz...@gmail.com> wrote:

--

Darius Jazayeri

unread,
Apr 6, 2015, 5:13:30 PM4/6/15
to dev
This worked.

Any idea how the search index could have been corrupted/invalid? (Maybe something to do with the way that we build the standalone databases by running the standalone and then stopping/killing it, and zipping things?)

-Darius

Rafal Korytkowski

unread,
Apr 7, 2015, 4:49:51 AM4/7/15
to Developers List
I think that before we ship standalone we need to drop the global property from the initial database. I'll see if it can be easily automated.


-Rafał

Kaweesi Joseph

unread,
Apr 7, 2015, 4:53:38 AM4/7/15
to Developers
We may have to generate a new demo data for 1.11.1 


- k-joseph

What we most need now is NOT legal religion BUT true and genuine conversion through Christ our righteousness


To unsubscribe from this group and stop receiving emails from it, send an email to dev+uns...@openmrs.org.

Rafal Korytkowski

unread,
Apr 7, 2015, 5:47:28 AM4/7/15
to Developers List
I've created https://issues.openmrs.org/browse/RA-633 with a possible fix that Daniel will test (I don't have Linux at hand to run standalone build).


-Rafał

Darius Jazayeri

unread,
Apr 7, 2015, 8:28:03 AM4/7/15
to dev

Remember that it's not the master branch of the standalone.

Also, while you're looking at the standalone, the welcome text in the UI says OpenMRS 2.0, but we need it to be 2.2, and ideally driven by the build property you pass in.

-Darius (by phone)

Reply all
Reply to author
Forward
0 new messages