firesphere

It should be able to find the abcd, I've not seen that being a problem...

Marcus Collier

well that problem (the html) happens with regular content pages as well, so it’s not an elemental issue, rather solr needs some more information on how to index that content.

MichalKleiner

not sure what field type you using, there are ways how you can use solr filters and analyzers to get rid of html or other stuff etc.. how you index and/or query these fields etc. there’s quite a lot to it

FTP works with Solr 5 & 6, at least there was a PR towards that and those changes worked fine, we used it on a project with Solr 6 a couple years back and the tweaks were minimal.

With Firesphere’s module there might be lots of moving parts other people don’t understand, you’re relying on one or two people to address all your issues at the moment, which is not the case with FTS. You weigh the pros and cons. To be precise, definitely give both a go and decide for yourself, just giving you another point of view.

MichalKleiner

That is elemental.. it indexes rendered elements (I know, don’t get me started)

Marcus Collier

so after getting it to index html, it still seems a bit flakey - like solr now has the field as a htmltext, but it appears to be indexing it like text. as in this bit of text:

  1. \n \n\t <div class=\"element dnadesign__elemental__models__elementcontent\" id=\"e39\">\n\t<div class=\"content-element__content\">\n\t\n <p><span style=\"color: var(--text-color);\">abcd</span></p><p><span style=\"color: var(--text-color);\">efgh</span></p><p>&nbsp;</p><p><span style=\"color: var(--text-color);\">&nbsp;qwert&nbsp;</span></p><p>&nbsp;</p>\n</div>\n\n</div>\n\n \n\t <div class=\"element dnadesign__elemental__models__elementcontent\" id=\"e38\">\n\t<div class=\"content-element__content\">\n\t\n <p>Testing content here</p><p>Home GHome Home!</p><p>&nbsp;</p><p>Peanut</p><p>&nbsp;</p><p>Maybe not at the end?</p>\n</div>\n\n</div>\n\n \n\n
Marcus Collier

@MichalKleiner I did, hmm, trying to think of how we got here. Basically I came into this channel asking questions where @firesphere directed me to his new version. The issue that I was having trying to perform the search, as I didn’t know very much about solr, pretty new to silverstripe and concerned that fts only supported solr4.

MichalKleiner

@Marcus Collier did you try the fulltext-search module that SilverStripe supports? It might be easier to get answers around that as that’s the “standard” of sorts nowadays… Firesphere is doing some development on his search module, which is great and will benefit the community, but it’s not a widely adopted solution yet.

firesphere

Yeah, hmmm, I forgot I added the casting check! 🤣

Marcus Collier

I’ve got another workaround to the html issue - I managed to look to see how it determined the ‘type’ the field was, and found that I could inject a $casting property into my sitetree extension.

  1. private static $casting = [
  2. 'ElementsForSearch' => 'HTMLFragment',
  3. ];

it now sees it as a htmlfragment and configures the solr schema accordingly! This is possibly a cleaner solution, as you can tailor the type to the method.