26 0
Sign in to rate

Searching, PDF reading & note-taking in "Add" dialog

0.69MB. Updated 2019-11-19. Only supports Anki 2.1.x.


This add-on initially aimed to add some search functionality to the Add dialog, but it now includes some other features as well that I wished for in my personal workflow (or that I at least wanted to try out). I am writing this for personal use, but maybe someone out there might profit of it too. I wanted a functionality like this because I don't like the default add card dialog, which is like a black box for me where I just insert my new information. I prefer to have some context, e.g. what other notes I already have that might be related to what I am currently writing. Another use case would be browsing my existing notes, determining the notes that need improvement (bad retention, long answer times) or even the topics (represented by tags) where I am struggling, and while I do that, I want to be able to add new notes or to edit the existing ones. Bonus point is that I can learn html/js/css by coding this :-) What the add-on does is to build a search index out of your decks, which can then be queried. When you type, it tries to find the note whose text is the most similar to what you have typed or selected. Because naturally, many common words are present in a lot of notes, there is a list of words that should be ignored (so called stop words). Examples in english would be "the", "a", "I", "for", etc. I cannot know what languages you write your notes in, so you have to build it by yourself. The default configuration contains an english stop word list for starters. The stop word list is defined in the config file, and you should fit it to your language(s) before using this add-on. Your searching will take longer and be less precise if you don't use stop words. All UI concerning the search is displayed on the right side of the dialog (it is only displayed above a certain window width and height, so don't be confused if it may not be there when you start). The index is built everytime you start Anki, and by default uses your whole collection. At the moment, notes you delete are not deleted from the search index until you restart. Same goes for notes you edit during review or in the browser. Notes you edit through the edit button in the Add Card dialog are updated immediately. Features atm include: - Selecting text inside a field or inside a displayed note allows to search for it - Automated searching if you type, or if you input tags - Edit another note in the add window - Timeline to see how productive you have been in the current year (CTRL + hovering will show you the cards added on that day) - Predefined searches - Info dialog for displayed notes - Browser search mask that works exactly like the search you know from the browser window - Defining synonyms/related terms to include when searching - Defining stopwords to ignore when searching - Defining fields to ignore when searching or to hide in the results - Browsing/searching for tags - Browsing related tags and their notes by hovering over a tag - Toggling between normal add dialog view and the add-on (by default CTRL-F) - Notetaking with taggable and searchable notes - Reading PDFs inside the add window, with marking pages as read, extracting images and finding related notes Please note that some of the following screenshots might be outdated. Toggled: (press CTRL-F to switch to the search pane) Toggled the other way + grid + sidebar hidden: Editing: "Timeline" (CTRL + hover to see the info): Tag info (a little wonky atm): Night mode styling: [WIP] PDF View in night mode styling: [WIP] Making Clozes Explanation of the options: deck select - only cards from the selected decks are returned as results search on select - if activated, selecting some text (with the mouse!) in the input fields on the left will trigger a search search on typing - if activated, typing in the input fields on the left will trigger a search. you may want to disable this if you feel that search is slowing down the typing or distracting you. search on tag entry - if activated, typing in the tag input will bring up all notes (atm from all decks, not restricted by your current deck selection) that have at least one of the entered tag. Works with parts of hierarchical tags to. highlight results - if activated, matched words are highlighted yellow (does not work in 100% of cases currently, but mostly) freeze - freeze the current results random - will display a number of random notes from your currently selected decks fields - will search for the current content of all fields PDFs - will list all notes that are linked to a pdf file The search results are updated when a field on the left is changed, if a query is entered through the bottom search mask, or if text is selected on the left. Results are notes, not cards, where fields are separated by a | character. Clicking on a note will show some (very basic) evaluation on how you performed on card(s) of the note. Clicking on a tag of the note will add the tag to the currently edited note. Results can be pinned / removed (this will only remove the displayed result, NOT delete anything!). Support for synonyms / query expansion (24-03-19) If you enter "What is Anki?" on the left side of the dialog, your search results will only contain notes with "anki" in them. But you might want to retrieve related notes too, that do not contain the term "anki", but maybe something like "spaced repetition". Another use case would be word inflection, because currently, stemming is not activated in the index (that would be language dependent), which means searching for "space" and "spacing" will get different results. If you click on the small s icon on the upper right, you will see a dialog that allows for the input of synonym sets. These are used when searching, but only for the search during typing or selection, not for the browser search. Terms are separated by ",". If you click inside a set, you can edit it and confirm by pressing enter. If you use synonyms, searching works like follows: - Suppose you typed "What is Anki?" - Your stopword list contains "what" and "is", so these are removed - One of your synonym sets contains "anki", so the query gets expanded by all the terms in the set - End query: "anki srs spaced repetition" You should maybe use this conservatively, since you might see too many results for simple queries otherwise. Browse Tags (12-04-19) You should now be able to browse the tags in your collection from the deck select. Clicking on a tag will find all notes (unrestricted by your current deck select, but by numberOfResults) that contain the tag. If your note has the tag top::middle::bottom and you click on either top, middle or bottom in the list, the note will show up. Experimental: Draggable notes (16-04) Added a button to make a note draggable. This is experimental and I am not sure if this is at all useful. You can drag the notes to the left if you need to keep their content visible and you don't want to pin them. Dragging is a bit sluggish for me on Windows, but it kinda works. (Resizing the window or dragging out of the window boundaries produces some weird behaviour though). A dragged note is like a pinned note, so if you have it displayed, and search for some of its contents, it won't appear in the search results. WIP: Notetaking / PDF reading This is currently still in development, but already functional. The idea is that you can create notes that are independent of Anki's notes, which are saved in a sqlite database in a folder you can specify. You can create/edit/delete these notes in the add note dialog. If you type or select text, these notes are included in the search results. They can be tagged, and that way, one can access them over the tag dropdown. The dialog for creating these notes allows them to be put in a "queue", the idea behind that is to have something like a reading list, so you can simply take the first (or a random) item from the queue, read a part, and create (regular Anki) notes while reading. When you are done, you can move the item to the end of the queue (or somewhere else). So this is basically a really light version of Supermemo's incremental reading. I currently use the feature for reading my uni textbooks and slides, pasting articles from the web to read later, to quickly create notes containing links or questions, e.g. for anything that could be converted to Anki notes later. My current workflow goes like this: 1. Add my textbooks, lecture slides etc. as PDF notes 2. 'Read Next', read for some time (I use 30 min pomodoro slices), make notes, mark difficult pages or pages I need to revisit again 3. Move the item back in the queue, most often somewhere at the end or last 3rd. 4. 5 min break, then read the next one. Adding PDFs atm is still a bit cumbersome, as it is only possible one-by-one through the Create Note dialog, but I plan on improving this next. Everything related to the notes can be accessed under the Notes tab. One caveat: The add-on notes are local to your machine. Config options: decks: here you can specify which decks should be used to build the index. If none are given, all are used. This can be useful, e.g. I have a giant premade deck of chinese vocab (6k notes I think), which I don't want to have in the index (because basically every english word is contained there). Names must exactly match the respective deck names. stopwords: stop words are terms that are not very meaningful concerning the relevancy of a document, simply because they are too common, e.g. 'in', 'a', 'the',... These words can/should be ignored when searching. If your language is different from english like mine or you are writing notes in multiple languages, I absolutely recommend building your own list here. Especially if you use the default SQLite FTS index, which seems to be noticeably slower without a good stopword list. numberOfResults: how many search results should be returned (1-500 are valid). This value is ignored by the predefined searches as you can set your own limit there, but for search on typing/selection/newest notes for a tag/notes added in the timeline, this value determines the max. number of displayed notes. A higher value might result in a more 'laggy' feel when using search on typing, as the typing typically lags a bit while the results are rendered, and more results means higher render time. useFTS: There are two possibilities to search: By default, sqlite fts (short for full text search) is used, but there is also the possiblity of using the included library Whoosh for that. There are different versions of SQLite FTS, the newest being FTS5. If you set this option to true, on startup the version available will be checked. If 5 cannot be used, 3/4 are used instead. I noticed that the index builds much faster on the fts versions than on Whoosh, however, the relevance ranking on fts4/3 is currently buggy, so your mileage may vary if you don't have fts5. I am on windows 10, and fts5 is included in my sqlite install, and I actually prefer this mode over Whoosh because of the faster startup. I suggest to at least try out fts, escpecially if your collection is huge. addToResultAreaHeight: If you see a vertical scrollbar at the right side of your window, most likely the result area (where the found notes are displayed) is too high. I suck at css and have not succeeded to make this always fit your exact window size. So for now, I included this lazy solution which lets you modify the height of the result area. Accepted values are -500 to 500 (without quotes). -100 means subtract 100 pixels from the height. delayWhileTyping: This is the amount of milliseconds, which are waited for until a search is triggered. The default value of 1000 means that if the user has stopped typing for 1 sec, a search is triggered. Minimal value is 500, I suggest not to set this too low because the typing might feel laggy otherwise. useInEdit: If set to true, the search interface can be used from the edit dialog (the one which can be opened during review) too. Should behave exactly like in the Add Card dialog. logging: If enabled, will print some information to log.txt in the addon folder. I used this for debugging. You should leave this disabled unless you have some problem and want to send me some additional information. fieldsToExclude: Accepts a map of note type name : [ field name ]. "fieldsToExclude" : { "myNoteTypeName" : [ "FieldToExclude1", "FieldToExclude2" ], ... } This will still show the fields in the output, they will be only ignored on searching. Because the highlighting is independent from the search process, the words in a field you excluded from search might be highlighted, but that does not mean that the field was actually searched. Styling: I added options to set the colors, backgrounds and font-sizes for some elements, so if you run night mode, you can adjust these. Colors accept everything you could write in CSS, e.g. "rgb(0,0,0)", "#ffffff", and "blue". I did not exhaustively check if all UI elements can be styled that way as I do not use night mode myself, so message me if I forgot something. In case I forgot some option here also check the changelog below. Some notes: IMPORTANT: I have no possibility to test on Mac, so I have no clue how things look there. So if something is off, please tell me, otherwise it will probably never be fixed. 1. Whoosh index typically takes more time to build (for me 30s to 50s, might be even longer for people with larger collections). I recommend using the SQLite FTS index (performance on this one varies depending on whether you can use version 3, 4 or 5). SQLite FTS is used by default. 2. Cards edited through the browser or deleted in the current session are not in the index/removed from the index until you restart the program. 3. I could only test how my cards look in the results, I have little media and mostly text, although the few images I had were displayed fine. There might be problems with very large images. 4. Mathjax is not rendered at the moment. 5. If you run Anki with the nightmode add-on, you can play with the config options for colors/backgrounds, but keep in mind notes are not inverted, so images with white background will still be white. 6. I don't think it will work well/at all with languages like chinese, that don't separate words on whitespace. 7. I noticed my search time rapidly goes up if the text contains lots of chinese characters. 8. No warranties about compatibility with other add-ons. I personally don't use that many, and it would be exhausting to test all possible combinations, so you have to find out by yourself. EDIT: I just realized I can't respond to bug reports here, so either post an issue here: https://github.com/fonol/anki-search-inside-add-card or, in case you have a reddit account, please send me a message (or comment in this thread: https://www.reddit.com/r/Anki/comments/axpvjf/search_collection_inside_add_cards_dialog/). Username is Brunzus. I will try to look after all bugs as soon as I have time. FAQ I want to change the looks of the addon. -> There is a config section called styling, where most colors can be set. If you want to switch between normal and night mode, there is a predefined styling config if you click on the Settings button, which you can simply copy paste into your config.json. When I open the add dialog for the first time, index creation takes too long. -> If you are not already using it, see notes point 1 above, try out the fts index. Otherwise, there is not much I can do about that, performance depends on your machine and the size of your collection. You can always exclude decks to reduce the index size. My searches take too long -> As stated elsewhere, search time depends on lots of factors, but the most determing one's are: Collection size, type of index used. I always get the fastest results with SQLite FTS version 5. You can check your version in the Info dialog. If you are using FTS 3, queries are much slower. I suggest trying to update your system's SQLite installation with one that comes compiled with FTS 5 support if possible. A note in the results seems to be displayed incorrectly (text flows out of the card). -> Some notes might contain html that breaks the container into which they are rendered. I try to catch these cases, but if you stumble upon such a note, please open an issue in the github repo with the note text. Sometimes a search is not triggered when selecting -> The search is triggered when the mouse up happens inside (!) the note (or field input). So if you mark some text, and leave the note area before releasing the mouse, nothing happens. I get ugly scrollbars in the right side of the add card dialog. -> I try my best to make the column on the right side always fill exactly 100% of the height, but I only succeeded on windows atm. So I included the option addToResultAreaHeight in the config file. See in the config section for an explanation. I have a note with lots of text, and typing seems to lag at some point -> Typing typically lags when the results are rendered. My advice would be to either increase the delayWhileTyping config value (I am a slow typer and have mine set to 1500ms atm), so searches aren't triggered too soon while typing, or to uncheck search while typing. I set useFTS to false, and get an import error when starting Anki -> If you are on Mac OS, your Anki is missing a library for Whoosh (the other type of search index that may be used). Atm there is no solution for this, so you have to stick with sqlite fts. What is this Performance stat? -> I wanted to have a stat that includes not only the pass rate of a note's cards, but also how long I took on average to answer these cards. So I simply came up with a crude formula that calculates a score (1-100) out of the pass rate and avg. time taken. I am open to suggestions about better stats to display there instead, so if you have any ideas, let me know. How are the keywords determined? -> The keywords are not really determined in a sophisticated way, it's just the words that appear most often in the top n results (n = 20 atm) , minus any stopwords. How do I add a PDF? -> Click on Notes -> Create -> PDF. In general, all notes are treated as PDF if their Source is a path to a file ending with .pdf. What is the "Queue"? -> The queue can be used to kind of schedule your reading, by taking the first item out of it (typically a pdf note or a note containing some pasted article from the web), reading some part, creating notes while doing so, then moving it somewhere back in the queue. This is obviously not fitting for everyone's workflow, but I wanted to try it nevertheless. CHANGELOG: 13-04-19: + added config options for colors and font-sizes 14-04-19: + added search button for last added notes 15-04-19: + added created date and search for notes created on the same day (by clicking on ranking number) 16-04-19: + added experimental feature: make note from results draggable (see above) + added config option for logging (activate if something doesn't work and you want to send me more info) - fix "Created x minutes ago" displaying floating point numbers - fix result rendering throwing an error for some users 17-04-19: + small UI changes + info dialog now displays exact FTS version (distinguish between 3, 4, 5 and none) - possible fix: if FTS4 is not detected, use FTS3, this might fix indexing not working for some linux users 18-04-19: + added some small status that is displayed while searching + searches that contain > 2000 chars are aborted now - fix disabled overflow when note contains lots of fields - did some changes to highlighting, it is more accurate now, but kinda slow on text with accented characters 19-04-19: + improvements for Whoosh: Search is now performed in background like fts, highlighting works better + added small info at startup + if you change your deck selection, last search should be repeated with the new selection + config useInEdit (experimental): if enabled, search is available in the edit window that can be opened during review 21-04-19: + selection and typing queries are now profiled, you can view the execution time by clicking on the ⓘ icon next to the time + improved speed of fts3 and fts4 queries + marked words next to each other should now be marked together - fix pinned items not being cleared when dialog is closed and opened again 27-04-19: + notes modified through the edit button are now updated in the search index (should work for Whoosh and SQLite FTS) - fix deck selector toggling itself after adding a card - fix entering tags in edit dialog triggering a search - fix backspace not triggering search on typing 30-04-19: + did some changes to the displayed info on notes (now opens in modal, which I like more because of more available space) + info on a note now shows a simple revision plot + added grid view (two columns, just checked and it doesn't seem to work on Ubuntu at first for some reason, but after toggling it on and off like 2-3 times it displayed correctly, will update when I found a fix) - fixed an error when loading the index and closing the dialog during loading 02-05-19: - fix error when closing add dialog while having an open edit window - fix note in the results being duplicated when result count is an odd number - fix note results rendering slowing down after doing a lot of searches 08-05-19: + add some more predefined searches EDIT: just tested it on my normal Anki installation, and the dropdown is totally sluggish. I don't know why, on my debugging environment, it ran perfectly smooth. For now, I'm gonna leave it like that until I found the reason. - fix collapse icon being reverted when add dialog is closed and top section is hidden - fix closing edit dialog with enter not updating displayed note 12-05-19: - fix notes in grid view not reflowing correctly when a note is removed from the results - tiny UI fixes 27-05-19: + added option to render the results immediately, instead of fading them in: renderImmediately + added option to make clicks on a tag search for notes with the selected tag: tagClickShouldSearch + decreased default font size of deck select - fix error when unselecting all decks and "last added search" is repeated 30-05-19: + added config option to control the window split (thanks to yzhang1337 for the idea): leftSideWidthInPercent controls how big the left column is, e.g. a value of 40 means a split of 40/60 + hide tags and keywords if window is small, to leave more room for the results + added option to show the retention for each result (small colored label under the result number): showRetentionScores + hovering over a tag in the results shows some info and related tags (if you hover longer than 300ms). This is still a WIP, it bugs sometimes and shows on the wrong side, but basically it works + added imageMaxHeight, setting this to e.g. 500 means all images in the results take at max 500px in height. 01-06-19: + reworked the bottom bar a bit, should be a bit prettier now + added some sorting/filtering to the bottom bar + added option to switch between search and normal pane when window is small - fix floating note not being deleted from list - fix grid not reflowing when making a note floating 02-06-19: + added support for chinese and japanese characters + improved positioning of the tag info a bit 03-06-19: + added a modal to set some stylings, mostly to point out that there is AddToResultAreaHeight, because the correct sizing seems to break easily on different screens 04-06-19: + added interval and answer times graph to the info modal - fix stats being mixed together for cards with same names in info modal 05-06-19: + added config option to hide the sidebar + try to hide images generated through the image occlusion add-on - fix loader sometimes shown when reopening add dialog 30-06-19: + added some predefined searches: last lapses, last reviewed, and time taken + right clicking on a note opens a context menu, which has not much content for now, maybe some actions will be added in the future + right clicking on an image allows to copy it to a field - if a search returns no results, the old results are not emptied anymore 01-07-19: + added toggle shortcut: CTRL-F (changeable through the config) - fix images sometimes overflowing their note in grid view 02-07-19: - info modal should now resize better when the window is small - don't show the tag info on hover if the window is small - grid/freeze/random buttons now hide their texts in small windows 04-07-19: + added a small timeline to the bottom, which displays each day of the year in a color depending on how many cards where added that day, still a bit rough, but it works. You can hover to see the cards on each given day. + improved the layout a bit, there might be less issues with the height of the right side being not correctly set + if you have the window in a large size, and you hide the right side with CTRL-F, the state should be remembered on closing the dialog 05-07-19: + added config option to hide the timeline (available also through the styling modal) + added config option to hide the tag hover info (available also through the styling modal) + some minor ui updates 12-07-19: - fix right layout being destroyed after note is added and top menu is hidden - fix last day in timeline being colored wrong 17-07-19: + added a config option to exlude fields: fieldsToExclude, see above for a short explanation 21-07-19: - fix timeline sometimes marking the previous day as the current day - fix error thrown when search on tag entry is enabled and the entered tag contains ' single quotes - fix some accented characters not being searched or being ignored on highlighting - include fewer related tags in the tag hover info if the related tags exceed a certain total length 29-07-19: + some ui changes in the info dialog + added a small graph in the info dialog that displays the reviews/intervals for each card + lapses are marked in the info dialog - renamed retention to pass rate - hopefully the last fix for the timeline 03-08-19: + if showTagInfoOnHover is enabled, and you hover over a tag, assuming the window is large enough, the tag info box also contains the newest notes for the tag. If you hover over related tags again, you can nest these windows. (I included a screenshot above). Clicking on one of the windows will close all others. + you can now search for a synset in the synset dialog - hopefully the absolutely last fix for the timeline 05-08-19: + Hovering tags on the left side of the tag info box now opens another box too, like in the 'related' section + 'mytag (+1)' is now shown as 'mytag::subtag' + Added an option tagHoverDelayInMiliSec, which determines how long to hover over a tag until the tag info is rendered. Editable through the styling modal. - fix related tags in some cases not being correctly determined - fix '${}' in the note text causing an error in the tag info - fix some of the filtering options not working after a filter has been applied that would have removed all results - fix styling modal throwing an error if input field is empty 07-08-19: + added a config option to disable printing of excluded fields: showExcludedFields + try to show fields with just a single image in their own line - changed default value of imageMaxHeight to 100 px - fix image occlusion images being rendered after note has been edited 08-08-19: + reworked the styling part of the config, all colors/font-sizes are now under a section called "styling", so you might need to reset your config.json, but absolutely save your stopwords/synsets before, as they will be reset too! + I included a sample styling section for night mode compatibility in the Info dialog - fix grid view icon not being colored blue after reopening add dialog 10-08-19: + added a Rebuild Index button under Info + try to not always rebuild the index, this works for most of the cases, except for edited notes outside the add-on pane and for notes that changed decks. In those cases, you can use Rebuild Index. If you want to disable this feature, you can set alwaysRebuildIndexIfSmallerThan to some high value. + added alwaysRebuildIndexIfSmallerThan config option, should be self-explanatory 14-08-19: + removed showExcludedFields config option, excluded or hidden fields can now be set independently under Settings -> Set Fields + added pagination, this means a better performance (only have to highlight the current page, have to render less html overall), this also means you should set numberOfResults to a higher value, I set the default to 1000. + because pagination and timeline sit close to each other, I disabled the timeline hover by mouse, you can either press CTRL and hover to get the same behaviour, or click on a single day. - fix some logic errors in the display of hierarchical tags 15-08-19: - fix showExcludedFields still being output in the index dialog 16-08-19: - fix error after pasting image into empty field - fix tag modal not appearing on tags with "..." 22-08-19: - fix some display issue with buttons on deck select - pinned notes should now work better with the grid view 01-10-19: + [WIP] user notes: notes that are independent of Anki's notes, which can be used for whatever you like, these are NOT synced and saved in the addon's user_files folder + [WIP] User Notes have a "reading modal" and a queue which allows to read e.g. saved articles from the web + reworked the deck/tag select, in general the top menu bar is now a bit sleeker + added settings option to remove <div> tags from printed notes, this might fix problems with notes that contain html with unclosed div tags. - some more fixes - some more tiny UI changes 02-10-19: + [WIP] user notes: replace <h1> and <h2> tags in pasted HTML + Create modal should now never be bigger than the actual screen size - (possible) fix for some user's having problems since the update - fix browser search bar at the bottom sometimes not appearing even if enough place is there 03-10-19: + [WIP] italic and bold buttons in create dialog, options to format pasted text - fix: browser right click context menu should now be available again when this add-on is enabled - fix: images that are added to a note by rightclicking and choosing "append to.." should now have the right path 05-10-19: + More formatting buttons in the Create dialog + Option to 'Save as Plaintext' in the Create dialog + Added 'Recent' section in the Create dialog + Display first 5 queue items in the reading modal + Added config option to set a folder to store the addon's notes in (to allow some kind of sync with e.g. Dropbox) - fix: clicking on a nested tag in the tag dropdown should now search for the full nested tag, not for the last part 06-10-19: + Indexing now includes numbers: Like words, they have to match exactly, so if you have a note with "1111" in it, "111" will not match. Like for single characters, single numbers are ignored. 18-10-19; + added note scale feature (under settings & info): If set to a value other than the default one, this currently disables the tag info on hover + recent tags now include tags from the addon's notes too + slightly changed appearance of grid mode (might change again in the future) + improved performance of highlighting + grid mode is now saved in config, so it should be activated on next startup + added highlighting buttons to create note dialog + added confirm dialog when deleting addon's notes + stopwatch in reading modal now continues when modal is closed - fix bugs on saving edited note from reading modal 20-10-19: + add shuffle button to queue tab + add toggle button in reading modal - fix: grid view checkbox wrong after index rebuild - fix: error on 'search' in synonyms dialog 21-10-19: + add WIP version of PDF viewing! In the create dialog, click on the PDF button, select a file, the open the "Read" dialog for the file. Still very early-stage (no text selecting, wonky controls, might take some seconds to load for large files, does not remember location), but I'm gonna improve on that + fix some styling issues in the create dialog 22-10-19: + mark pages as read in pdfs + add Fields button, on clicked it searches for the current content of the fields on the left + add note create button in reading modal + search on typing: ignore some more keys - fix: user note text being deleted after reading modal was closed (bug introduced yesterday) - fix: notes not fading in if grid view is active and Render Immediately is unchecked - lots of other fixes 23-10-19: + make Whoosh work again + reworked the top bar button (deck/tag select, notes etc.) - they should now open only on click (I found the hover annyoing) and have an animation + changed reading modal background color + opening pdfs displays a loader now + added a dialog to open any item from the queue from inside the reading modal - lots of bugfixes 24-10-19: + Selecting text in PDFs works now! + Added a little progress bar to the PDF view + better styling of the "Create Note" modal in night view - fix a lot of bugs concerning the reading timer 25-10-19: + extract images from PDFs! + zooming PDFs with ctrl + mouse wheel - fix: pdf pages read being deleted after pdf note is edited and saved 26-10-19: + added PDF button to quickly access all notes that are linked to a .pdf file + updated some parts of the add-on description - fix some more issues with the timer in the reading modal - fix bottom bar in reading modal not being updated when a note is created in the reading modal - fix created notes with empty text sometimes having an empty paragraph inserted - change cursor of pdf image selection to crosshair - fix image still being added to user's media folder if cancel is clicked in field select 27-10-19: + the search bar on the bottom can now be toggled between the addon's search and the regular browser search - fix some issue with the text selection in PDFs 30-10-19: + added ctrl-shift-n as shortcut to add a note (meta-shift-n on Mac) + changed the way read pages are stored, this means any read pages up to now might be lost, but this enables to ... + ... open a PDF at the page marked as read last + ... display a little progress bar for PDFs outside the reading dialog + added fit to page button + added button to switch the reading modal between left and right side - bugfixes 06-11-19: + selecting text inside a PDF should now trigger a search for related notes (both regular notes and 'add-on notes') + added a 'meta' note as first result if you click on PDF, which allows for different ordering of the results (e.g. last read first) - fix pdf not being centered when zooming out - fix last read page not being marked as read when loading a pdf where the first page is unread - fix dialog for selecting queue items not being dark in night mode 09-11-19: + search speed for FTS3/4 should now be much better, especially for large queries and/or asian characters + reader now has a night mode which inverts the PDF's colors + changed some styles (mainly borders and buttons), fixed some UI problems - fix a bug on searching selected text in PDFs 12-11-19: + improvements on the pdf selection tooltip, should now separate the words better in some cases + extended the queue picker dialog (accessible from the reading modal), it is now possible to add existing pdf notes to the queue from it, this is useful if one has read some pdf (e.g. lecture slides 1), and quickly wants to add the following pdf (e.g. lecture slides 2) + experimented with pdf colors, there is now a "Sand" color theme (comes after night mode) 17-11-19: Forgot to write down last update's changes, so they go in here too: + [WIP] Cloze generation when selecting text in PDFs (works only if you have a note type named "Cloze" with a field "Text") + only reload reading modal bottom after another pdf has been loaded, not everytime the queue picker dialog is closed + added "..." button in the reading modal, with some useful actions for marking pages as read + somewhat improve PDF page rendering when switching fast between pages - fix deck selector sometimes not displaying correct selections - fix images cropped from PDF being slightly shifted to the right - fix rare bug on index creation - fix the absolute last™ bug on the timer 19-11-19: + added marks that can be set on single pages of a PDF, to label pages when you need to e.g. reread them, or collect more info from external sources etc. PLEASE: Don't use the reviews for bug reports, either open an issue on Github or write me a message on reddit (user: Brunzus)! https://github.com/fonol/anki-search-inside-add-card


As add-ons are programs downloaded from the internet, they are potentially malicious. You should only download add-ons you trust.

To download this add-on, please copy and paste the following code into the desktop program:


If you were linked to this page from the internet, please open Anki on your computer, go to the Tools menu and then Add-ons>Browse & Install to paste in the code.

Other Anki 2.1.x Add-Ons Ask a Question


on 1574154419
It quickly developed into one of the most extensive add-ons of all. Proper documentation.

I was seriously contemplating buying a 2nd screen. 5/5
on 1573952360
when it was just for searching it was already amazing. the note taking and pdf support makes it even better.
on 1573950305
Greatly underappreciated add-on.
Thank you!
on 1572762606
Brilliant !!!!
on 1571616720
on 1570587506
This add-on is amazing for med students if you have downloaded multiple shared decks (zanki, bros, etc)
on 1569969538
Getting a major error everytime I try to add a card.

Debug info:
Anki 2.1.12 (eef86bf3) Python 3.6.7 Qt 5.12.1 PyQt 5.11.3
Platform: Windows 10
Flags: frz=True ao=True sv=1

Caught exception:
File "aqt\webview.py", line 317, in handler
File "aqt\editor.py", line 351, in <lambda>
File "aqt\addcards.py", line 187, in _addCards
File "E:\!Programs\ankidata\addons21\1781298089\__init__.py", line 1222, in addNoteAndUpdateIndex
File "E:\!Programs\ankidata\addons21\1781298089\__init__.py", line 1229, in addNoteToIndex
File "E:\!Programs\ankidata\addons21\1781298089\fts_index.py", line 400, in addNote
conn.cursor().execute("INSERT INTO notes (nid, text, tags, did, source, mid, refs) VALUES (?, ?, ?, ?, ?, ?, '')", (note.id, clean(content, self.stopWords), tags, did, content, note.mid))
<class 'sqlite3.OperationalError'>: no such table: notes
Comment from author
This place here is a bit awkward to have a conversation, but if you don't have a github/reddit account: Can you include answers to the following in your comment:
1. Did you already have the add-on and run an update or did you newly install it?
2. Does the error persist after you clicked "Rebuild Index" in the menu?
3. Does the error persist after you deleted "search-data.db" in the addon's folder and restarted Anki?

Edit: And you could try the newest update :)
on 1568798864
The default browser search sucks, this one is awesome!
on 1568718266
👍 🔥
on 1567055171
Thank so much!!!

Can you help me?
How do I limit search fields to just question fields?

Oh thx i just downloaded update and it works
Comment from author before post was edited
Settings -> Set Fields should do exactly that
on 1564348504
on 1563977397
This is probably the single most powerful addon for anki in terms of card production and efficiency. Excellent work!

If I may make a suggestion: the ability to natively suspend and unsuspend cards would be amazing. This way, the user can see when the time has come to unsuspend the relevant cards from the giant shared medschool decks when making the cards for that class/lecture.
Comment from author
Hey, thanks for the feedback. About suspending/unsuspending, that would be nice, I'll have a look at how difficult that would be to add.
on 1562339391
This is AWESOME!
on 1562011844
In my Mac system, enable this plugin, the right mouse button is disabled
I disabled it and hope to fix this bug earlier.
Comment from author
Can you do either a bug report on Github or send me a message on reddit? From your text I have no idea what's going wrong. Thanks :)
on 1558337797
Very useful add-on!
on 1557998044
Thank u
on 1555577212
Fantastic. Terrific. Excellent. Brilliant. Pure gold.
on 1555275627
Awesome, keep going!
on 1555242612
Thank u
on 1554997567
thank you!
on 1553662028
Great addon doesn't work with nightmode. Similar to tags being invisible.
Comment from author
Yea, no nightmode support yet. If the problem with the display of tags is independent of the night mode, please open a github issue or send me a direct message on reddit, I won't be able to help otherwise.
Update (13-04): You can adjust the colors in the config now, images and note text are not inverted, but it is better than nothing :)
on 1552651416
I loved this addon
on 1552522529
Nice, friends!
on 1552522004
Great. I loved the idea. What is missing so as not to be BETA?
Comment from author
Index should rebuild if you add/delete cards during a session, fts3/4 should rank the results correctly, UI doesn't resize right for some people,... lots to do :)
on 1552516430
one of the best add-ons
on 1552301847
Congratulations on your addon. He will be very helpful.