Bug 91743 - Consider adding directory indexing/search
Summary: Consider adding directory indexing/search
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Find-Search Commandline
  Show dependency treegraph
 
Reported: 2015-05-30 08:58 UTC by David Hedlund
Modified: 2019-11-29 13:29 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Hedlund 2015-05-30 08:58:01 UTC
Recoll finds keywords inside documents as well as file names.

Here's a script that can be use in the same way

#!/bin/bash

shopt -s globstar;  for file in "$2"/**/*.ods ; do if { text=$(unzip -p "$file" content.xml | xmllint --format - | grep -e "$1"); } 2>/dev/null; then echo "$file:$text"; fi; done


I evoke it with ./libreoffice-search.sh test /path/


However, neither Recoll nor my script is part of LO. Would it not be able to search documents with libreoffice from the terminal instead?
Comment 1 Joel Madero 2015-08-27 16:27:12 UTC
Hi David -

I've talked to a couple QA people about this an no one really understands what you are requesting. Can you please clarify and then set the bug to UNCONFIRMED. Thanks
Comment 2 David Hedlund 2015-08-27 23:28:54 UTC
I meant: Would it not be nice if it would be be possible to search LO documents with libreoffice from the terminal.
Comment 3 David Hedlund 2015-08-27 23:29:13 UTC
Or from any LO GUI.
Comment 4 Andreas B. 2015-09-03 19:47:20 UTC
This script is a Fulltext search for all *.ods Documents in a folder.

You open a terminal, enter the search command and the search term, and it shows you, which document contains the text.

I never saw that in a Richt text editor, but each good text editor contains such a functionality, usually called "Find in files" (e.g. available in Notepad++)

So if you have a folder with .ods document, and search for a specific word WITHIN all these documents, you can search it that way.

I would also recommend such a feature ;-)

But for standard users it has to be a GUI dialog, not a commandline script.
Comment 5 David Hedlund 2017-06-26 14:32:01 UTC
I agree that it should be GUI for that reason.
Comment 6 David Hedlund 2018-06-16 19:23:52 UTC
https://askubuntu.com/questions/938834/grep-for-text-in-odt-or-doc-files/938914#938914 lists a script for fulltext search for _all_ LibreOffice (OD* files) documents in a folder.

#!/bin/bash

find . -type f -name "*.od*" | while read i ; do
   [ "$1" ] || { echo "You forgot search string!" ; exit 1 ; }
   unzip -ca "$i" 2>/dev/null | grep -iq "$*"
   if [ $? -eq 0 ] ; then
      echo "string found in $i" | nl
   fi
done
Comment 7 Zio3D 2019-09-09 09:54:58 UTC
Hi.
This feature is interesting also for me.
It would be very useful.

Thanks,
Davide.
Comment 8 Xisco Faulí 2019-11-29 13:29:54 UTC
Changing priority back to 'medium' since the number of duplicates is lower than 5