New contrib repository request - Solr Live Data macro

Hello everyone,

I created a macro whose general intent is similar to the one of the LiveTable and LiveData macros except it queries the data over Solr. I understand it could also make sense to provide directly a Solr backend to the LiveData macro however such a backend might be more complex to implement, at least for me :slight_smile:

Here’s a demo on the EDNH project’s web site (a European project XWiki SAS contributes to with AFP and several other press agencies) and a syntax example below.

That’d be great if someone could create a code repository and a Jira project for this macro, such as “macro-solrlivedata”, what do you think? Initially I named it “solrLiveTable” but “solrLiveData” might be more appropriate since the layout is a grid, not a table. It uses Velocity macros + JSX (both building on the existing Solr code pages), not Vue. Any feedback, question or recommendation is welcome of course.

{{solrLiveData
  query="f_class=XWiki.Article.ArticleClass&f_property.XWiki.Topic.TopicsClass.list_string=topics.health.WebHome&f_locale=en&sort=property.XWiki.Article.ArticleClass.publicationDate_sortDate&sortOrder=desc&hidden=false"
  facets="XWiki.Topic.TopicsClass.list,XWiki.Category.CategoriesClass.list"
  limit="12"/}}

(we could introduce complementary parameters such as “className”, “filters”, “sort” etc. to make it easier to use)

Cheers

Stéphane

1 Like

Hello @slauriere,

This would requires two improvements we discussed but did not implement yet:

  • a solr live data source
  • a new layout for livedata that would be close to the grid layout, but with a displayed image

While what you propose also intend to display paginated content, I’m -1 to use the livetable or livedata keywords as, if I understand correctly, your macro does not have any code in common with them.

Also, we changed slightly the naming conventions recently and something like solr-search-grid, with a solr-search-grid-macro sub-module would be more appropriate.

WDYT?

Otherwise, the demo looks really cool :slight_smile:

Thank you @mleduc for your reply and your positive words. I agree with you that solr-livedata would be confusing. “Grid” reflects well the behaviour indeed, what if we keep the “live” naming scheme and use something like solr-livegrid or even shorter, livegrid? Emphasizing the fact that this macro allows to use the Solr facets will be important its short description, but maybe not necessarily in the name, what do you think?

+1 for livegrid

Meantime @lucaa pointed out that the “live” prefix now refers more to the ability to edit data directly in view mode (in livedata) hence this may introduce some confusion here since this is not the intent. We came up with the name searchgrid. What do you think about it?

Github: GitHub - xwiki-contrib/searchgrid
Jira: Loading...

1 Like