[GH-ISSUE #46] search.py: how to use it, description in readme? #28

Closed
opened 2026-03-01 14:39:59 +03:00 by kerem · 1 comment
Owner

Originally created by @zaszlo on GitHub (Oct 2, 2017).
Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/46

From the issues I've found out about the recommended search.py way of searching in the archive. I Have set the archive path.

For some search terms I get this exception but for others it just works as expected.
Maybe I'm not doing something right?

./search.py "church"
Traceback (most recent call last):
File "./search.py", line 66, in
print('\n'.join(matches))
File "./search.py", line 16, in
return (l.decode().replace(archive_path, '') for l in ag.stdout.splitlines())
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xcc in position 75: invalid continuation byte

If I add the --exact parameter to it, it will not yield the exception but also no results are given.

Originally created by @zaszlo on GitHub (Oct 2, 2017). Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/46 From the issues I've found out about the recommended search.py way of searching in the archive. I Have set the archive path. For some search terms I get this exception but for others it just works as expected. Maybe I'm not doing something right? ./search.py "church" Traceback (most recent call last): File "./search.py", line 66, in <module> print('\n'.join(matches)) File "./search.py", line 16, in <genexpr> return (l.decode().replace(archive_path, '') for l in ag.stdout.splitlines()) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xcc in position 75: invalid continuation byte If I add the --exact parameter to it, it will not yield the exception but also no results are given.
kerem closed this issue 2026-03-01 14:39:59 +03:00
Author
Owner

@pirate commented on GitHub (Oct 3, 2017):

search.py isn't finished yet, for now you can run the search command directly:

https://geoff.greer.fm/ag/

brew install the_silver_searcher
# OR
apt-get install silversearcher-ag

Then

cd ~/path/to/archive
ag 'search-term.*with-regex'
ag -Q 'exact-search-term'
<!-- gh-comment-id:333938015 --> @pirate commented on GitHub (Oct 3, 2017): `search.py` isn't finished yet, for now you can run the search command directly: https://geoff.greer.fm/ag/ ```bash brew install the_silver_searcher # OR apt-get install silversearcher-ag ``` Then ```bash cd ~/path/to/archive ag 'search-term.*with-regex' ag -Q 'exact-search-term' ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ArchiveBox#28
No description provided.