# Silly indexing question



## lovesangelrn (Dec 28, 2009)

I keep seeing people post on the kindle FB page that the kindle has to reindex all the books if it is turned all the way off and then back on.  Is this true?  I don't usually turn my all the way off, I'm just curious for the sake of airport security (would hate to have it re-index my over 300 books after going through security). That, and I would hate that misinformation is being spread to kindle newbies if this is indeed false.

I did alot of google searching and couldn't find a definitive Amazon answer anywhere...bet I could find is that it would re-index if you did a hard restart...which makes sense.  So, do any of you know the answer to this?  I'd check with my kindle, but I have a K2 and perhaps the K3 is different


----------



## NogDog (May 1, 2009)

I've never heard of this, and would be surprised if it were so -- not shocked such that it turned my graying hair white sort of surprised, but pretty darned surprised it would have been designed so stupidly. Ultimately the index is going to be a file of some sort, and I can think of no reason that file should be more volatile than any other file on the Kindle.

Maybe I'll go try a little test on mine before I go to bed....


----------



## Betsy the Quilter (Oct 27, 2008)

So, NogDog, did you do the test?  Inquiring minds want to know!
  

Betsy


----------



## NogDog (May 1, 2009)

Betsy the Quilter said:


> So, NogDog, did you do the test? Inquiring minds want to know!
> 
> 
> Betsy


Yeah, I didn't see any signs of indexing. I turned it completely off, let it sit for a minute, turned it back on, and then immediately tried two searches from the home screen: first for a nonsense "word", which returned no matches and no indication that it could not search any items (which you normally get for any item which is still being indexed); and then the second search for a "real" word, which was successfully found in a bunch of my books. So if any sort of re-indexing occurred, it must have occurred really, really fast (like single digit seconds), which I doubt was the case.


----------



## telracs (Jul 12, 2009)

It's not the turn off that forces a re-index, it's a hard reset (holding the power button for about a minute and allowing a full reboot).  This has happened to me a few times when the kindle has frozen and I've had to reset it.


----------



## NogDog (May 1, 2009)

scarlet said:


> It's not the turn off that forces a re-index, it's a hard reset (holding the power button for about a minute and allowing a full reboot). This has happened to me a few times when the kindle has frozen and I've had to reset it.


Makes sense -- sort of. (I'm not sure why a hard reset would have to erase the index file, but maybe the developers figured a corrupt index file might be one potential cause that would require a full reboot?)


----------



## telracs (Jul 12, 2009)

NogDog said:


> Makes sense -- sort of. (I'm not sure why a hard reset would have to erase the index file, but maybe the developers figured a corrupt index file might be one potential cause that would require a full reboot?)


the hard reset seems to wipe EVERYTHING. actually, i should say "seemed" because i've not yet done it on the new DX. when the kindle reboots, it does not immediately show all the books that were on it, they reappear in batches. so, it seems to reload and reindex.


----------



## Morf (Nov 18, 2010)

Hmmm,

I've just restarted my Kindle twice, once from the menu (Settings...Menu...Restart) and once with the holding the power switch until your finger hurts ( ), and although I see the effect of the books not appearing for a couple of seconds (the collections all show 0 books for a moment), I saw no signs of it re-indexing, I carried out NogDog's tests and got the same results.

So I suspect it's actually only a reset to factory defaults which wipes the index, and I'm not going to test that for obvious reasons!


----------



## telracs (Jul 12, 2009)

Morf, unless you've done a search for a dummy phrase, you might not "see the effects" of re-indexing.  As I said, I've not had this happen on the new DX, but I speak from experience on my old one where I had this happen a few times.  And I know it was re-indexing because I did the search.


----------



## lovesangelrn (Dec 28, 2009)

scarlet said:


> It's not the turn off that forces a re-index, it's a hard reset (holding the power button for about a minute and allowing a full reboot). This has happened to me a few times when the kindle has frozen and I've had to reset it.


This is what I thought. Not that it's a huge deal, since most people know that leaving a Kindle in sleep mode is best; I just really hate the idea that new kindle owners are being giving false info on the Kindle FB page (I tried to correct someone once, and got about 3 replies saying I was wrong, which is what sparked this discussion). Thanks for the trial and error guys, I appriciate it


----------



## Morf (Nov 18, 2010)

scarlet said:


> Morf, unless you've done a search for a dummy phrase, you might not "see the effects" of re-indexing.


When I said I tried NogDog tests, I meant this:



NogDog said:


> ...immediately tried two searches from the home screen: first for a nonsense "word", which returned no matches and no indication that it could not search any items (which you normally get for any item which is still being indexed); and then the second search for a "real" word, which was successfully found in a bunch of my books.


So yes, I did do a nonsense search, and no, I did not get an error just "No Items". I've just repeated the test with the same results.

I stand by my test: *on my Kindle 3 (UK 3G, B00A serial number, running V3.1) a restart does not apparently cause reindexing* (unless, as NogDog says, it finishes in seconds, and there are 200 books in there so I doubt that).

That doesn't mean to say that this applies to all machines in all circumstances: as I understand it (http://en.wikipedia.org/wiki/Amazon_Kindle) there have been two versions of the DX, the older white one (B004 serial number) and the newer graphite one (B009), and neither have the same OS version as the Kindle 3 so either or both may behave differently.



scarlet said:


> ...I've not had this happen on the new DX, but I speak from experience on my old one where I had this happen a few times. And I know it was re-indexing because I did the search.


Were they different versions - was the old one a B004 and the new one a B009? It may be that Amazon have changed this behaviour in the newer OS.

If other people want to do the same test (after all, it's not as if a restart causes any harm) and report their results and version numbers we might be able to pin down the exact circumstances in which reindexing does and doesn't happen.


----------



## Annalog (Dec 28, 2008)

My Kindle is a K2 US (B002A) running version 2.5.6. Based on my past experience with hard restarts, sometimes my Kindle reindexes but usually it doesn't. Similarily, sometimes it resets the date/time to midnight 1 January 1970 and sometimes it doesn't.

I just redid the test and, with 4 pages of collections and over 1000 items on my Kindle, this time the clock was reset to 11 PM on 31 Dec. 1969 but the Kindle did NOT reindex as no items are shown as not indexed. (Somehow it remembered I was in Arizona and not on daylight savings time but in December?) I did my standard search for "brillig" which has the advantage of being both a nonesense word and one that is found in only 4 items on my Kindle so all the results plus the number of unindexed items show on the first page.  Since I have so many items on my Kindle, the search takes about 4 minutes.

It seems to me that my Kindle has decided to reindex when I have deleted several items from my Kindle. 

OK, turning wireless back on so my date and time are correct and items I open will not go to the end of the list. I reopened Calendar Pro so that it would not be at the end of the Active Items list and it sees that it is once again 2011.


----------



## Ann in Arlington (Oct 27, 2008)

Annalog said:


> I did my standard search for "brillig" which has the advantage of being both a nonesense word and one that is found in only 4 items on my Kindle so all the results plus the number of unindexed items show on the first page.  Since I have so many items on my Kindle, the search takes about 4 minutes.


I search for something like xqprz which isn't in any of the books. . .even with 700 titles the results come back pretty quick.


----------



## Annalog (Dec 28, 2008)

Thanks Ann!When I searched for xcvbn the result came back very quickly. I will be changing my search string.


----------



## Ann in Arlington (Oct 27, 2008)

I think it's because the search is a little bit smart and knows there aren't any real words that begin with two or three random consonants.  It would probably take longer, though if you searched schxgqz because there are words that begin sch. . . .  At least, that's my analysis, but who knows!


----------



## Annalog (Dec 28, 2008)

Ann in Arlington said:


> I think it's because the search is a little bit smart and knows there aren't any real words that begin with two or three random consonants. It would probably take longer, though if you searched schxgqz because there are words that begin sch. . . . At least, that's my analysis, but who knows!


What was funny is that after I did the xcvbn search, then I searched again for brillig in order to time it. That search only took a few seconds! Not sure if it was it still had the previous search in memory, if it had the index in memory, or if my Kindle had needed a restart for some reason. To check if it was the previous search, I did a search for slithy; that also came back in a few seconds. Who knows!


----------



## Morf (Nov 18, 2010)

brillig isn't a good word to use for this test, because it does appear in a book (assuming you've got Alice on there!). You need to search for something completely random, I just rub my thumb straight over the middle of the keyboard and so get a truly nonsense word.

Remember that brillig may be nonsense to you, but it's a word to the Kindle because it appears in a book.

The way indexing works, if the word isn't in the index, it will report back very quickly that this is the case. If it is in the index, it then has a lot more work to do, because it has to do a lookup from the index to find the word in the books where it appears, then it has to open the book and look up the word, then it has to pull the location out of the book and display it. This all takes time.

I suspect that it caches the search results, so if you do the search again straight away, it will have the answers already to hand.

No idea why slithy was quicker, maybe it's a woody word and brillig is a tinny word! (Monty Python, http://orangecow.org/pythonet/sketches/woodytin.htm)


----------



## Annalog (Dec 28, 2008)

I was using brillig and slithy as I do have the Alice books on my Kindle and I wanted to check that the word was found. Even if the word is found, the Kindle will display the number of unindexed items if any items are unindexed. What I found interesting was that a search for an indexed word was faster after doing a search for a non-indexed non-word.

However, if I am doing a check just for unindexed items, I will use a non-word string.

I decided to do a retest while writing this post. I did a search for "xcxbcbxbxcxd" and it took my K2 over 2 minutes to return the No Items response. NOT very fast. I followed this search immediately with a search for "brillig" and the four items where the word was found was returned in a couple seconds. Very strange. A repeat search for "xcxbcbxbxcxd" then only took a second or so. I suspect that the index might be loaded into memory.


----------



## Tatiana (Aug 20, 2010)

I have a replacement Kindle and had to download (and therefore index) my entire 900+ book collection to my new device.  After reading this thread I did a test.  I typed in qwerty and searched and it took 4 minutes to search and tell me 97 books were not yet indexed.  I immediately tried typing in zxwp and search...it took about a minute and told me that 96 books were not yet indexed. 

As I downloaded my books in batches of 100 I continued to check on the indexing using the zxwp string and it searched quickly, much quicker than the qwerty that I had always used previously.  It wasn't just because this is a new replacement K3 that it searched quicker I had been using qwerty with my new K3 (I'd downloaded and indexed 600 books by the time I saw this thread).  The zxwp search was definitely quicker than qwerty.  I wonder why.


----------



## Morf (Nov 18, 2010)

Annalog said:


> Even if the word is found, the Kindle will display the number of unindexed items if any items are unindexed.


Ah, I didn't realise that, I've never had the "unindexed items" problem, so I was just going on what I had read elsewhere. Apologies for the confusion!



Annalog said:


> What I found interesting was that a search for an indexed word was faster after doing a search for a non-indexed non-word.
> ...
> I suspect that the index might be loaded into memory.


This could indeed be the correct analysis.


----------



## Annalog (Dec 28, 2008)

Annalog said:


> Even if the word is found, the Kindle will display the number of unindexed items if any items are unindexed.





Morf said:


> Ah, I didn't realise that, I've never had the "unindexed items" problem, so I was just going on what I had read elsewhere. Apologies for the confusion!


That is OK.  If there are unindexed items found when searching for an indexed word, the number of unindexed itrems is displayed at the end of the search list. That is why it is best to search for a string that will not be found or for a string that will only be found in one or two places.

One of the causes of books that will not index (and related battery drain due to the Kindle constantly trying to index the book) is a book file with a corrupted location. One cause of corrupt locations is downloading a book over a weak and unreliable wireless connection. Since I live at the edge of 3G phone service, this was a problem for me in early 2009 when I had problems with books with corrupt locations. I learned to make sure I had a strong signal first, download via my computer, or check to see if the book indexed. At least one time the sample on Amazon was corrupted when the book was OK.


----------

