I want all the documents to be removed from a particular index in Redisearch. I have come across commands for deleting records with the documentid known. Can we delete all the records without using documentids?
Please suggest something. Thank you.
Could you just drop the index FT.DROPINDEX and recreate it?
Probably already solved in your case, but since the google sends here as one of the first result and it's still not resolved:
Use FT.DROP "indexName".
It's not to be found in the official documentation list but for me it worked.
Related
I noticed a mechanism of auto inserting when selecting rows by index. To illustrate, I use the following code:
Then my questions are 2 (may be they are the same):
Any document about this mechanism? (I have tried but cannot find it in the long long official documents)
How to avoid the auto inserting? For example, I want the last line of code returns the only 'a' row.
Thank you very much in advance!
I have not seen any documentation. It looks like an unintended artifact. I can think of some clever things to do with it but I wouldn't trust it.
Work around
df1.loc[pd.Index([1, 'a']).intersection(df1.index), :]
So, ContentSearchManager.GetIndex(SitecoreIndexableItem) is returning null. Im pretty sure we might be missing an index. When using the sitecore master database, everything works fine, but in web is null.
I guess the question is, is there a way to know which index is GetIndex trying to recover that is returning null.
If you haven't overriden the default Sitecore logic for getting the index, Sitecore checks all the indexes which are registered in the configuration and for each of them, it checks if the SitecoreIndexableItem passed to the
ContentSearchManager.GetIndex(SitecoreIndexableItem)
is not excluded from that index.
Then is simply returns the first matching index.
So the answer to your question is - Sitecore check all indexes if they are a match for your item.
You may want to look through your logs for an error like this:
"There is no appropriate index for {indexable.AbsolutePath} - {indexable.Id}. You have to add an index crawler that will cover this item"
This may help you find which item is not indexed at all.
Is there a way to get Lucene/Elasticsearch to just show what fields have been indexed in a given index? I'm trying to figure out whether certain fields have been indexed properly as a result of configuration options, but I have no idea how to make that determination.
You can check the mappings for a specific index and type via a call to:
http://localhost:9200/index/type/_mapping
Anything indexed should have an entry there.
See also analyze API to see how text is broken into terms.
http://www.elasticsearch.org/guide/reference/api/admin-indices-analyze.html
I'm using Alfresco 3.4d and imported some nodes as well as created a few with NodeService. Today I noticed that a Lucene query by ID does sometimes return two rows instead of just one. Not all nodes show this kind of behavior.
For example, when I execute the following Lucene query in the Alfresco Node Browser, I get the result shown below: ID:"workspace://SpacesStore/96c0cc27-cb8c-49cf-977d-a966e5c5e9ca"
How is it even possible that a query by ID can return more than one row? I tried rebuilding the Lucene index, but it didn't help. When I delete the node, the query returns 0 rows. What can I do to remove those "ghost" nodes from the query result?
I also ran across this problem and asked the Alfresco support for advice. They told me that it is perfectly normal to have duplicate entries in the lucene ID field and that this is related to whether there is an ANCESTOR present or not. They recommended using the sys:node-uuid field when doing a lucene search for the node's ID, e.g.:
#sys\:node-uuid:f13a21dd-b020-4c70-aa21-1a0e5c89d42b
I've seen this problem since Alfresco 3.2r, but maybe it is even older! I used the Lucene index Viewer "Luke" (http://www.getopt.org/luke/) to check the index directly and I saw that the corrupt index entry contains almost no information. As workaround we combined our search to some basic information like node type or aspect. I will ask a colleague if he has more information about this.
I don't know directly how this is possible but in your 'code' where you retrieve the nodes you could always do: if node.isDocument or node.isContainer to get true result or type is cm:content or cm:folder.
You could also try to re-index, but I doubt that will be of any help
I'm running a simple test--trying to index something and then search for it. I index a simple document, but then when a search for a string in it, I get back what looks to be an empty document (it has no fields). Lucene seems to be doing something, because if I search for a word that's not in the document, it returns 0 results.
Any reason why Lucene would reliably return a document when it finds one that matches the given query, and yet that document has nothing in it?
More details:
I'm actually running Lucandra (Lucene + Cassandra). That certainly may be a relevant detail, but not sure.
The fields are set to Field.Store/YES and Field.Index/ANALYZED
Interestingly, I'm able to get this to work just fine on my local machine, but when we put it on our main server (which is a multi-node cassandra setup), I get the behavior described above. So this seems like probably the relevant detail, but unfortunately, I see no error message to clue me in to what specifically is causing it.
Unsure if this will work with Lucandra, but you have tried opening the index using Luke? Viewing the index contents with Luke might help
It's hard to tell what the problem is since you only provide a very abstract description. However, it sounds a bit like you are not storing the field value in the index. There are different modes for indexing a field. One option determines whether the original value is stored in the index to retrieve it later:
http://lucene.apache.org/java/3_0_0/api/core/org/apache/lucene/document/Field.Store.html
See also the description of the enclosing class Field
Read: http://anismiles.wordpress.com/2010/05/27/lucandra-an-inside-story/