Giter Site home page Giter Site logo

Comments (12)

robbieaverill avatar robbieaverill commented on July 16, 2024 1

Fixed in #156

from silverstripe-fulltextsearch.

dhensby avatar dhensby commented on July 16, 2024 1

wow - good job figuring this out!

from silverstripe-fulltextsearch.

robbieaverill avatar robbieaverill commented on July 16, 2024

Hey @tractorcow or @chillu - do you have any context to provide here?

from silverstripe-fulltextsearch.

tractorcow avatar tractorcow commented on July 16, 2024

Can you check that you've run through all the steps in https://www.cwp.govt.nz/developer-docs/en/1.7/features/solr_search/tuning_the_search_results/#search-term-synonyms-2?

Does your index extend SolrSearchIndex?

from silverstripe-fulltextsearch.

PsukheDelos avatar PsukheDelos commented on July 16, 2024

from silverstripe-fulltextsearch.

PsukheDelos avatar PsukheDelos commented on July 16, 2024

Hey @tractorcow,

I can confirm that everything is set up as expected. I am able to make changes within the CMS to the synonyms config and see them reflected in the synonyms. txt file that is generated in .solr.

The custom index extends CwpSearchIndex, which I can see contains the relevant synonyms code. However, it does not extend SolrSearchIndex (which is itself an extension of CwpSearchIndex in this case).

I have also been able to replicate this by swapping out the custom index and using the SolrSearchIndex directly instead.

-Glen

from silverstripe-fulltextsearch.

tractorcow avatar tractorcow commented on July 16, 2024

Ok, the fact that synonyms.txt exists in that folder is a good sign; The issue is in the solr configuration, not in your code.

Next step is to debug the XML that solr is using... which requires a bit of docs reading and understanding to debug.

from silverstripe-fulltextsearch.

tractorcow avatar tractorcow commented on July 16, 2024

gdp, jel, knp

Could it be a min-character for synonyms isn't being met? Check that setting first. :)

from silverstripe-fulltextsearch.

PsukheDelos avatar PsukheDelos commented on July 16, 2024

I have done a fresh CWP 1.7.0 install to eliminate any further variables. I've created three pages with their page name, navigation label and content as "tortoise", "kangaroo", and "stingray". This uses the standard SolrSearchIndex.

When I search for these terms without synonyms, the relevant individual pages are returned as expected.

However, when I add synonyms to the config (and run Solr_Configure to see them reflected in the synonyms.txt) no search results appear for any of those words now. Instead I get Sorry, your search query did not return any results.

from silverstripe-fulltextsearch.

tractorcow avatar tractorcow commented on July 16, 2024

However, when I add synonyms to the config (and run Solr_Configure to see them reflected in the synonyms.txt) no search results appear for any of those words now. Instead I get Sorry, your search query did not return any results.

Depending on your config you will ALSO need to run Solr_Reindex. Synonyms can be configured either against the query, or against the source dataset; The latter will require a re-index for it to activate.

from silverstripe-fulltextsearch.

PsukheDelos avatar PsukheDelos commented on July 16, 2024

Hi Damian,

I have run Solr_Reindex. I usually do just in case. I'm using a standard CWP 1.7.0 installation and am getting no results.

You might be onto something however. Maybe the instructions for setting up synonyms or the implementation of synonyms with the CwpSearchIndex don't go far enough to actually implement query time synonym use. From the CWP set up instructions it says It's not necessary to run Solr_Reindex in order for changes in synonyms to take effect., meaning that it must be designed to use synonyms at query time, although perhaps that is not actually implemented. Do you know where in cwp, cwp-core, or fulltextsearch that it is actually set up to use synonyms at query time or is does SOLR simply do this itself when synonyms.txt is present?

from silverstripe-fulltextsearch.

tractorcow avatar tractorcow commented on July 16, 2024

Do you know where in cwp, cwp-core, or fulltextsearch that it is actually set up to use synonyms at query time or is does SOLR simply do this itself when synonyms.txt is present?

Here is the query config that declares query-time synonym interpolation.

https://github.com/silverstripe/silverstripe-fulltextsearch/blob/master/conf/solr/4/templates/types.ss#L140-L154

It looks like this is uploaded directly to CWP, so you could possibly force it to index-time if you wanted to.

from silverstripe-fulltextsearch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.