Is there a way to "Expire" items in an Azure Search Index? - azure

In Azure Search is there a mechanism to set an "Expiration Date" on items within the index? I have a need for items to only be in the search index for a pre-defined period of time.

Not at this time. For now, you need to send a delete request to delete an item in an index.
We often refer to this capability as Time to Live. It would be great if you could vote for this feature to help us prioritize it, if you would find it valuable.
http://feedback.azure.com/forums/263029-azure-search/suggestions/6328648-time-to-live-for-data
Liam

As Liam mentions, there isn't at the moment.
One option might be to add an "Expiry" field with a type of Edm.DateTimeOffset into your documents and have all your queries only request documents whose expiry date is greater than the current timestamp.

Related

What does unique records mean in GetStream?

In the getstream pricing page it is mentioned that the Free plan has 600,000 unique records. Is there any section in dashboard where I can see how many unique records I have used?
Also can I know what does a unique record means exactly?
unique records are all activities and feeds.

Azure DocumentDb "high water mark"/timestamp

I'm looking to implement a process that will occasionally pull all "new" records from a DocumentDb, where new is "all documents added or modified since the last time the process was run."
SQL Server has rowversion for this, which is guaranteed unique and monotonically increasing across all rows and columns in a database.
I see DocumentDb has _ts, which (according to the documentation) used as a high water mark for Azure Search indexing, but how does that work? If multiple documents are inserted at the same time as a read takes place, it's possible that all of them have the same _ts value. On the next read, if the comparison against _ts is strictly greater than, then some documents will be missed; if it's greater-than-or-equals, some documents will be pulled a second time.
Is _ts safe to use for this?
The _ts property is specific to a document, not a collection of documents. It represents the time that a particular document was updated (in seconds, since Jan 1 1970).
The _ts property will not give you a high water mark across all documents in a collection. Each document has its own independent _ts property (which may have the same value as another document's _ts property).
See this answer for a bit more detail.

Sorting of document collection with compromising performance in SSJS

I want to sort notesDocument collection based on any key or date in ascending order ( document creation date). Actually I need data to display in data table in descending order so that user can view most recent record on the top.
Please provide me solution to sort the collection but I don't want to compromise the performance.
Thanks,
Qaiser
Qaiser,
if you want to avoid a performance hit, don't use database.search. It is the equivalent of a full table scan without an index. Bad idea.
The better way: create a view that has all the columns you need and is sorted the way you need it. So your first column would be the field with the user name, categorize it, then a column with the date, sorted.
Then you can use a ViewNavigator which is the fastest construct in Domino.

How to monitor SharePoint list?

I have a SharePoint list with the following fields.
1.Event Name
2. Hit Count
I want to monitor this list by the hit count for events on a yearly basis. What is the best approach I could take?
Options:
Create views for each year.
EDIT:
Adding a field for each year, on the 1st of January will populate the number of fields in the list. Is there a better way of doing this?

Show specific document on top in search for specific keywords in solr

Suppose, I have 1000 sellers (S1.....S1000) of Apparels listed on my site. Since all the sellers are paying some amount to me, I am giving them equal weight-age, and the results are shown based on relevancy.
Now, I am planning to start with premium service, where I am thinking to list one supplier on top for each keywords in search results. Let say, S1 has been given premium search for keywords 'Jeans', so if a user searches 'jeans', I first wants to display this supplier on the top, then display other supplier based on relevancy. Plus, this premium service is for only for one month. So, another supplier say S2 can avail this service in next month and so on.
Is there any plugin, wherein I can store which supplier should be shown for which keyword. I am even OK with making 2 queries to meet the desire results.
Please suggest
I think the Query Elevation Component is your friend, you can configure which documents (and hence which suppliers) come first for any given query, see
https://wiki.apache.org/solr/QueryElevationComponent
If that's too much work, you could also add a new boolean field in your documents, indicating whether the document is to be promoted or not, and in the query, sort by this field first (so promoted documents come on top), and by score next (so most relevant documents come right after the promoted ones).
You can maybe also use the reRanking Componant :
https://cwiki.apache.org/confluence/display/solr/Query+Re-Ranking
With using a query like this :
q=jean&rq={!rerank reRankQuery=$rqq reRankDocs=1000 reRankWeight=3}&rqq=(brand:S1)
The top 1000 of results from query jean will be re-ranking thanks to the boost (of 3) add to the documents which contain the field brand with the value S1.
It can be useful, but in your case I think the QueryElevationComponent is the best.
Be careful, reRanking is only available since version 4.9.

Resources