How do we prevent alphabetical ordering of returned facet values? - algolia

We're searching our index on algolia through the api and rendering facets and their values each time the search is updated. Each facet returns a maximum of 5 values to show the user.
When a facet attribute is selected, the search result json returns that facet and its attributes re-ordered first by their count and second by alphabetical order. Usually the just-elected facet value is shown first and we're happy with that.
If we then select another facet with a count of say 10, then in the returned search results, if there are other facet values that have not been selected but that also have a count of 10 and are higher up in alphabetical order they'll popup ahead of the just-selected facet removing it from sight for the user. And that's unusual because the user expects to see what they just selected in the returned results.
How can we ensure that the returned search result facet values show up in the order: highest count, selected, and then alphabetical as opposed to highest count, alphabetical?
Thanks

This question was cross-posted to Algolia's forum, you can see the full discussion here.
The short answer is:
"The main problem here is that you are using the raw API Client
instead of the JS Helper which we strongly recommend: it handles a
search state internally, it has advanced features built-in (like
facets sorting) and it's really easy to use. You can go from a JS
Client to a Helper implementation very easily (you won't struggle if
you switch)."

Related

Advanced tag filtering not working for more than one tags selected in same collection

The problem I'm having right now is related to advanced filtering in shopify theme "Fashe"
I have made certain filter groups in my store using advanced filtering by group option. But when i choose a filter in one category, I want other filters to be updated as well related to that category.
Like If i choose collection type to be of one kind, i want the collection colors to be related to those kind only. right now it shows me all the colors available in my store. If choosing one filter, it should change the values in other filters also based on the collection type.
If somebody has this issue resolved, I would be very much pleased if you help me with this.
SECOND THING
One more issue is when I select filter A, the theme gives me the results associated with that filter but when i click Filter B (filter A being selected already) the theme gives me no results instead it shows that no products matching. Somebody with this issue???
Example: www.mytheme/collections/fine/opt1+opt2
This works as an AND statement. But I want to show results from both, opt1 and opt2.
Shopify should work with OR statements. Like combined results of filter A and Filter B.

DOMINO REST API get Collection sort column

Hi I'm trying to get a sorted Collection from the Domino Rest Api. My database name is "Test/JSON_Views.nsf" and my views name "List".
The endpoint I use is
**/Test/JSON_Views.nsf/api/data/collections/name/List?sortcolumn=title&sortorder=ascending&count=20
But the JSON-Response entries aren't sorting by title in ascending order.
Should I make any settings to the column properties in the designer? If I set descending there for the title-column it works. But I want to change the sorting in my external java-application.
Is my endpoint correct? I use this Domino API Docu as Reference.
Add an additional sorting to your title column:
This gives the API the possibility to sort by title in both directions. You can do this with other columns too so you are very flexible in sorting this way.
The doc says that if the column isn't sorted in design then the sortcolumn parameter has no effect, so the answer is "Yes" you should change the design of the desired column. If doing that is unworkable in whatever context you use it, then create a second view and use that instead.

Typo3 - Indexed Search how to order results by page title?

Inside the advanced options of the Indexed Search result page, there is an option to order results. While all other options are working fine, the two fields inside "Order by" have no influence on the results order.
The configuration page of indexed search has an option "basic.flagBitMask" where it says you can increase the importance of and tags, but setting it to "128" to increase the title importance has no influence at all.
How to get this options working or is there another option to show results with the searchword in the title on top of the results list?
I used the default index_search.tmpl which comes along with the extension.
The Typo3 version is 7.6.6, Indexed Search version is 7.6.0.
This problem seems to be a bug. In current versions of Indexed Search ordering is not possible when MySQL driver for Indexed Search Engine (indexed_search_mysql) is used.

Algolia Tags vs Facets Use Cases

New to Algolia, and having a bit of trouble deciphering the difference (suggested use) of tags vs. facets -- they seem to be functionally equivalent.
The Algolia documentation gives one example of a tag with a user ID -- e.g. "user_1234", which could then be used for filtering.
However that seems functionally equivalent to simply having this in your JSON:
"user": "1234"
and then declaring "user" as a faceted field.
What's the difference / purpose? Why have both tags and facets?
You're indeed correct that both can give you the same filtering functionality.
The main difference comes from facet counts that are computed at indexing time, which takes time.
That's why you can now add in your attributesForFaceting setting an onlyFilter modifier to your attribute, like so:
{
attributesForFaceting: [
'onlyFilter(user)'
]
}
This will tell the engine that the user attribute should be considered as a tag or tag list (this syntax is currently undocumented, but should soon be).
The same logic can be applied to numeric attributes. By default, the Algolia engine creates data structures for all numbers indexed in order to quickly answer to queries like nb_views>10000.
This is also computation-heavy, which is why you can add the equalOnly modifier in the numericAttributesToIndex.

In a TFS 2010 Work Item Query can I add two field values as the "Value"?

I would like to create a team query for our TFS users that shows all task items where the sum of the [hours remaining] and [hours completed] fields exceed the [original estimate] value.
Now Whilst I can add a clause to the WIQL that compares one field to the value of ONE other field (Which I had to ask you kind folks in stack exchange how to do in How do I write a TFS 2010 Work Item query clause whose value is a field value? which was answered by PVitt with admirable politeness - Since I had simply failed to read the "operator" drop down properly!)
I am struggling to find a way of querying the sum of two fields.
For example:
This query clause works;
And Completed Work > [Field] Remaining Work
What I really want is something along the lines of;
And Completed Work > [Field] Remaining Work+Original Estimate
The problem is either this cannot be done, or my wild guesses as to the correct syntax for summing two field values have all been wrong.
Specifying two filenames separated with a + just yields a TF51005 error
Similarly guessing at a "macro" like Sum(Remaining Work+Original Estimate) or Sum(Remaining Work,Original Estimate) results in the same.
So is this even possible?
if it is how would I go about this?
What you want is not possible. Your options are to use:
1) the object model to write C# code that iterates over the work items from a query and do the math yourself
2) run the query in excel and do the calculations and filter in excel
3) use ssrs to create a report that does the math for you
If you think this is important, you can always post your suggestion on user voice: https://visualstudio.uservoice.com
Add a new hidden field to store the sum, install TFS Aggregator and set it up to update the hidden field when the workitem is updated.
Then perform your queries off the new field.
There may be a couple of minutes delay between updating the sum having the new value.
<AggregatorItem operationType="Numeric" operation="Sum" linkType="Self" workItemType="Task">
<TargetItem name="Total Work"/>
<SourceItem name="Remaining Work"/>
<SourceItem name="Original Estimate"/>
</AggregatorItem>
If you're soley focused on the results/don't mind a (short) trip outside TFS, what I do is run the TFS query that produces the individual results I need, then just select all/copy/paste the results grid into Excel. There you'll have access to all Excel's suming and auto (col headers)/advanced filtering capabilities. You can define criteria that reference other cells using this method as well. Can also use the "If()" fcn to (in/ex)clude cell values in straight formulas. W/ some Excel fancy footwork, should even be able to preserve the summing fcns btw runs/pastes.