Org Search Engine

Org Search Engine

Trying find a way to rapidly search my org notes and find what i want , i found out that org agenda can be used as a search engine. setting org-agenda-file to a directory it searches thought the directory to find all the org file and adds them , But my notes are scatters in different folders , found this piece of code which works wonderfully

(add-hook 'org-agenda-mode-hook (lambda ()
                                  (setq org-agenda-files
                                        (mapcar 'abbreviate-file-name
                                                (split-string
                                                 (shell-command-to-string "find ~/Dropbox/org -name \"*.org\"")
                                                 "\n")))))

1.Org agenda as search engine

2.Multiple Direcory agenda