How to change taxonomy ordering in Orchard CMS - orchardcms

I am using Orchard CMS. I want to change the ordering of taxonomy items. Now it's ordering alphabetical. How can to change its ordering to be based on create date?

You can create a Query and sort it based on create date and then use this query to create a Projection. And you can use this ProjectionItem as a MenuItem.

Taxonomy terms are sorted by the weight, as you can see in this image.
If the taxonomy term "A" has weight 8 and the taxonomy term "B" has weight 7, the term "A" will appear before term "B".

Related

Solr default search field for multiple fields which has different analyzers

I have a document which has title, stockCode, category fields.
I have different field types (and analysis chains) for each. For instance title has EdgeNGram 2 to 20, category has EdgeNGram 3 to 10 with different range and stockCode just has lowercase filter.
So that, I don't want to search from documents with keyword "sample" with building the query like title:sample OR stockCode:sample OR category:sample.
I'd like to search with just "q=sample".
I copied my fields to text but It does not work. Because all fields analyzed as same. But I don't want to index stockCode as EdgeNGram or any other filters. I'd like to index my fields as I configured and I'd like to search a keyword over them base on my indexes.
I've been researching about that for three days, and Solr has a little bit poor documentation.
You can use the edismax handler, as this will allow you to give a list of fields to query and supply the query by itself. You can also give separate weights to each field for scoring them differently.
defType=edismax&q=sample&qf=title^10 stockCode category
.. will search for sample in each of the three fields, giving a 10x boost to any hits in the title field.
You can find the documentation about the edismax query parser under Searching in the reference guide.

Algolia search keywords

I want to build a smart search with Algolia. The point is to use keywords to rank the results. Lets say user types "smarphone blue cheap good camera". This should find all blue smarthones and order them by price and camera characteristics.
The idea is to somehow map those keywords to a ranking formula.
Doea any one know if it is possible with Algolia and if so what is the best way to achieve the desired result?
To automatically detect and filter by facet values (like blue, good camera), you could use Query Rules, in particular Dynamic Filtering.
However, that shouldn't be necessary. If you include the color (containing for instance the blue value) and characteristics (containing for instance the good camera value) attributes in your searchableAttributes list, then the search request will return relevant results based on purely textual relevance matched in those attributes.
On the other hand, sorting strategies impact the Algolia indices at build time, therefore in order to change the sorting strategy based on the query (e.g. sort results by ascending price if the search query contains cheap), you will need to setup a new replica index for which results are sorted by price. On the frontend, when detecting a relevant keyword (e.g. cheap), you can decide to switch the search queries to the primary index or to the sorted replica.

Azure search filtering performance over Edm.Int32 and Collection(Edm.String)

I'm using Azure Search on my e-commerce site, and now want to implement filtering.
I've faced issue with performance. I have index with products. Each product belong to category. Each category can have nested subcategories.
My business purpose is when customer is on category page i need to show products even from subcategories, so i have doubts about how to store this relation(products to categories) in azure products index.
I'm considering two possibilities:
I can store only products category id in field with type Edm.Int32. Then when customer goes to this category i query to my sql server to get all subcategory ids and then construct my query to index like this
categoryId eq 34 or categoryId eq 36 or categoryId eq 37 ...
Other way is to create field with type Collection(Edm.String) and to store products category id and nested categories ids in this field and then my query to index would look like this
categoryIds/any(c: c eq '35')
So which way will be faster?
Option #2 is likely faster since the number of documents in the index will be far fewer, but the only way to be sure is to run some experiments with your data and queries. Overall query performance is going to depend on other factors like whether you're doing full-text search, faceting, geo-spatial, etc.

Solr: Apply faceting when query contains particular terms

I have a database of product information indexed by name, type, manufacturer, etc. Users often submit search queries whose results would be contained neatly in one or more facets. When this situation arises, I would like for Solr to parse the query and apply the relevant facets.
For example, searching shoes should return results in the shoe category. More ambitiously, searching plaid shirt should query plaid on items in the shirt category.
Is it possible to configure Solr to do this?
Thanks in advance.
Asking Solr to do what you want is a tall order. Your best bet would be to store categories in a field that is weighted very highly. For example, if you have a category field with the value of "shoes", having a hit on that field will increase the relevance of documents on that category, thus having them show up first. Same goes for the second example.
As for faceting, your question is not clear on how you want to apply faceting.

Lucene is not finding results that are present in the index

I'm inspecting a Lucene index with Luke.
All documents have a field 'Title' and I would like to do a search for the search expression Title:Power, by which I want to find all documents with a title containing the word Power.
In Luke, I go to the tab "Search" and enter +Title:Power
When searching, there are no results. However, when I search by another field, I do find the document: +ContentType:MyContentType
In the column Title, I can clearly see the value of the document being: Power Quality Guide.
What could be the reasons I'm not finding this document when searching on Title?
There can be a number of reasons. Most common ones:
Title field could just be stored in the index but not indexed for search (Field.Store.YES, Field.Index.NO), unlike for the field for which you can find results (ContentType);
document(s) could be indexed using one analyzer but query is using a different one;
document is indexed using NOT_ANALYZED option which would store a field as a single term

Resources