I have Apache Solr configured in my Drupal 7 installation. With Apache Solr Views, when selecting the filter to search terms & selecting Attachment Content as the field to search the terms in, the view does not display any result. I am able to connect to my Solr installation, have indexed all content and attachments & the text has also been extracted from the attachments. I can see the text results if I search the terms in the search block, however, not in the View created from the Apache Solr Index.

Please advice.

Thanks

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

maverick129 created an issue. See original summary.

MiroslavBanov’s picture

If you have extracted the content of file attachments, and indexed it in Solr, can you find it using Solr administration?

Try to access the solr admin, and query directly from there:
http://HOST:8983/solr/
(replace HOST with your host name or IP address that Solr runs on. If it's local, you can use "localhost")

If you are unable to see the extracted contents of the file attachments in Solr, then the problem is that the contents are not extracted or aren't indexed.

maverick129’s picture

Thanks for your reply MiroslavBanov. Yes, I am able to access Solr admin, I am able to view the extracted content from the attachments when I query in the core search box, however, the results don't come up if I try to search within the Views filter created from the Solr Search Index.

Below are the Steps I followed to create a View from my Solr Search Index :

I am using Apache Solr & Apache Solr Attachments Modules

1. Created a Solr search index to index the content type, custom fields, attachments and the attachment content.
2. Created a view selecting the Solr Search Index for View type
3. Selected Display Format: Table of Fields
4. Under Exposed Filters: Selected > Search Terms > Exposed Operator to Users > Search Fields - Attachment Content & other Full Text Fields

Basis of the above, when if I go in the view & put in my keyword to filter the results, it should display the nodes which have the selected terms in their respective attachments. However, when I input the keywords, it comes up blank, with no results

I am fairly new to Solr, using it for the first time, hence a bit confused if I am following the correct procedure.

Please advice, if I have missed out on any step to achieve the desired results?

Thanks

MiroslavBanov’s picture

I really don't understand this part:

4. Under Exposed Filters: Selected > Search Terms > Exposed Operator to Users > Search Fields - Attachment Content & other Full Text Fields

Maybe a screenshot can help me understand.

Also, the module will allow you to make a simple text filters on string and text fields. The fields are taken directly from Solr, so if it's indexed, it can be retrieved and used for filtration. Refer to this code: http://cgit.drupalcode.org/apachesolr_views/tree/apachesolr_views.views.inc

You may also try with the "Fulltext search" filter. But you may need to alter what fields it searches in. Because Apache Solr will send some default boost parameters that probably won't include your specific Solr field that you want to search in.

Also, before you spend a bunch of time with this module, I want to give you a fair warning. If you need more advanced things - like integrating with facets, or having multiple filters that are not just textfields - then I would advice to try some alternative modules. Refer to the "Alternatives" section in the apachesolr_views project. On the other hand, it could be easier to extend and alter things programmatically with this module, because it is quite simple.

maverick129’s picture

I have attached a couple of screenshots of the filter for your perusal. I am using only text fields for searches no Facets. I am using Fulltext Search filter & I am able to select the fields I need in the filter. Do check & let me know what am I missing?

Thanks
Apache Solr Views Filter.PNG

 Apache Solr Views Filter 1.PNG

MiroslavBanov’s picture

So I am pretty sure this module does not expose any such options for Fulltext search. There are no operators to choose from and no "use as" option. This the actual code for the Fulltext search filter:
http://cgit.drupalcode.org/apachesolr_views/tree/handlers/apachesolr_vie...

So I really am not sure exactly what you are using right now. Add some break points and see if you are even using Apachesolr Views functionality, because I am not sure where these configuration options are coming from.

maverick129’s picture

Thanks for the reply MiroslavBanov. It seems the issue is not with Apach Solr Views but with Search API Views, my mistake.

Thank You for your help.

maverick129’s picture

Status: Active » Closed (works as designed)