# Search returns no results

**URL:** <https://discourse.project-emerse.org/t/search-returns-no-results/48>\
**Category:** Uncategorized\
**Created:** [April 21, 2020, 10:42pm UTC](https://discourse.project-emerse.org/t/search-returns-no-results/48 "2020-04-21T22:42:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bront](https://avatars.discourse-cdn.com/v4/letter/b/7feea3/32.png) [@bront](https://discourse.project-emerse.org/u/bront)\
**Post date:** [April 21, 2020, 10:42pm UTC](https://discourse.project-emerse.org/t/search-returns-no-results/48/1 "2020-04-21T22:42:41Z")

</div>

hi,

Emerse is up and running, but search is returning no results. In the top left of the Emerse window, I see the number of patients loaded (1,750), but no luck with search. And there is no on-screen error… just 0 results. The application diagnostics report good status for all types.

In catalina.out:

_Opening solr connection using url [http://localhost:8983/solr/documents](http://localhost:8983/solr/documents)_

If I curl to that url from the server, I get a basic auth error, and if I turn off basic auth, I get a file not found.

We had a bit of difficulty recently getting Tomcat and Solr to cooperate with regard to the cores. The script to install Solr as a service wanted the cores in **/var/solr/data,** but from the initial install we were targeting **/app/data/solr** as the path to the cores. Thus, our lucene.indexPath points to **/app/data/solr7**

I added the solr user to the tomcat group, and gave read/write/execute permissions on patient, patient-slave, and document directories in /app/data/solr7. Solr can now read these cores.

The search _was_ working when the lucene.indexPath pointed to /var/solr/data, but that’s not where our actual test data was loaded, and so if I point there now, I get the following error in the diagnostics:

_MRN 100001398 appears in lucene, but not in SOLR. Are both lucene and SOLR pointing to the same indexes?_

Many thanks for whatever help or direction you can provide.

bront

---

<div class="post-metadata">

**Author:** ![mcclaink](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.project-emerse.org/mcclaink/32/8_2.png) [@mcclaink](https://discourse.project-emerse.org/u/mcclaink)\
**Post date:** [April 22, 2020, 3:21pm UTC](https://discourse.project-emerse.org/t/search-returns-no-results/48/2 "2020-04-22T15:21:21Z")

</div>

It sounds like you have data in `/var/solr/data` since when you set `lucene.indexPath` to that, the diagnostics report there’s an MRN in lucene (ie, the path you set) but not in Solr. So, I’d double-check that you really have data in `/app/data/solr7`, probably by just making sure the directory is about as large as you’d expect, file-size-wise. Still, I’m guessing you do have data in there since diagnostics doesn’t complain.

The `/solr/documents` path should return 404; it’s just the base EMERSE is using to make a query. You can do an actual query like:

```auto
http://localhost:8983/solr/documents/select?q=*%3A*

```

Which will tell you how many documents are in your index total, and ten sample documents. If that doesn’t return anything, then Solr might be pointing to the wrong place. We set `SOLR_HOME` to our index path, but if you’ve installed Solr as a service, you might need to do something different. (Are you on Windows?) You can see a better overview of Solr in the admin panel, which will tell you what indexes are loaded and where they are. But, I’m guessing that’s all correct.

So, I’m not sure what the problem is… If you’ve just recently indexed the data, I would restart both Solr and tomcat, since both can have an “old” version of the index files open (the version before documents were indexed). (Solr / lucene can support old consistent views of the index kind of like how databases provide consistent views of tables in a transaction.)

When you do your search, are you doing an All-Patient search with no date constraints? Basically, once you log in, just type something into the input box and hit search? That should go to Solr and return anything that matches. If you have date constraints on, there could be an issue with the Solr field names indexed in Solr vs what EMERSE is using in its query, but it sounds like you have the sample data loaded, so I’d guess all that is configured correctly.

---

<div class="post-metadata">

**Author:** ![bront](https://avatars.discourse-cdn.com/v4/letter/b/7feea3/32.png) [@bront](https://discourse.project-emerse.org/u/bront)\
**Post date:** [April 22, 2020, 4:15pm UTC](https://discourse.project-emerse.org/t/search-returns-no-results/48/3 "2020-04-22T16:15:52Z")

</div>

Hi,

Thank you for your response.

Apparently, a background process ran last night (I see a timestamp from last night in the Patient\_List:Update\_Date field). So, I guess ActiveMQ kicked off the patient-index-replication? Is it possible to do this manually (I still have to set up the production server, so it might be helpful.)

[http://project-emerse.org/documentation/config\_guide.html?queryTerm=activemq#truesolr-patient-index-replication-interval](http://project-emerse.org/documentation/config_guide.html?queryTerm=activemq#truesolr-patient-index-replication-interval)

Also, we’re running on CentOS with Tomcat and Solr running as services.

Again, thank you for your help.

bront

---

<div class="post-metadata">

**Author:** ![mcclaink](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.project-emerse.org/mcclaink/32/8_2.png) [@mcclaink](https://discourse.project-emerse.org/u/mcclaink)\
**Post date:** [April 22, 2020, 5:17pm UTC](https://discourse.project-emerse.org/t/search-returns-no-results/48/4 "2020-04-22T17:17:38Z")

</div>

Yes, probably, though it isn’t ActiveMQ but just the scheduler inside EMERSE running in Tomcat.

You should be able to force all the batch processing to happen inside EMERSE’s admin app. Look here:

[http://project-emerse.org/documentation/administrator\_guide.html#truesystem-synchronization](http://project-emerse.org/documentation/administrator_guide.html#truesystem-synchronization)

It can be a bit buggy at times though ☹

You can also just force the indexes to re-open by making a get to:

`https://localhost:8080/emerse/springmvc/admin/refresh/indexes`

(depending on the port/host you have for EMERSE of course).

---

<div class="post-metadata">

**Author:** ![bront](https://avatars.discourse-cdn.com/v4/letter/b/7feea3/32.png) [@bront](https://discourse.project-emerse.org/u/bront)\
**Post date:** [April 22, 2020, 5:31pm UTC](https://discourse.project-emerse.org/t/search-returns-no-results/48/5 "2020-04-22T17:31:36Z")

</div>

Great. Thank you again for sharing your expertise as we continue with this project.

bront
