-6

I need the source code for STRI search module for implementing search in DXA Tridion.


I want to read the metadata values in while searching .Any way to do that or any out of box code.

1
  • I combined your follow-up answer with your original question. Stack Exchange sites are different from typical forums. Each "post" starts as a question to which the given Q&A community will provide answers. You'll get the best results on Tridion StackExchange (or any forum, really), if you do some research, try an approach, and read the documentation. Explain what you've tried (source code helps for technical questions), what you expected, and what the result was (behavior and/or stack trace if there was an error). Dec 1, 2015 at 21:53

1 Answer 1

3

Here are some links (which you can also find in the docs)

DXA Latest: https://github.com/sdl/dxa-modules/tree/master/webapp-net/Search

DXA 1.0.1: https://github.com/bkoopman/tri/tree/master/web-application/Modules/Search/Sdl.Web.Modules.Search

The DXA search is (out of the box) intended to be a very simple one box search and by default all content and metadata text fields are indexed into the body catchall index field.

If you want to ensure a specific metadata field is indexed separately, you can easily do this with SI4T (the search integration which the DXA uses) TBB parameters. Check the Custom Field Mapping section of the SI4T wiki.

In order to search this metadata field you will indeed need some custom code to generate a query with the format fieldName:queryString. Check out the Solr documentation on query syntax

4
  • I have implemented this functionality from the source code provided here, but here the search mechanism implements its functionality by searching the page name. I need my implementation to search from metadata provided for the page.any way to do that?
    – krish naik
    Dec 2, 2015 at 6:26
  • The metadata for the page should be indexed by default. Check that the default search field in your Solr index is the body field and not the title field: wiki.apache.org/solr/SchemaXml#The_Default_Search_Field
    – Will Price
    Dec 2, 2015 at 7:47
  • Thanks a lot. It saved a lot heck of time. One more thing when i am searching for a keyword just in case say baggage. It gives me 33 results whereas when i search "bag" it just gives me 3 results. Isn't it should provide me 33 results or do i need to do some changes in the solar schema config.
    – krish naik
    Dec 2, 2015 at 9:09
  • Your best bet is to directly query solr using the solr admin interface to try to troubleshoot whats going on here.
    – Will Price
    Dec 2, 2015 at 9:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.