Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show full path of files in the result #429

Closed
andreapx opened this issue Oct 4, 2023 · 16 comments
Closed

Show full path of files in the result #429

andreapx opened this issue Oct 4, 2023 · 16 comments

Comments

@andreapx
Copy link

andreapx commented Oct 4, 2023

sist2 version: 3.1.4

Platform (Linux or Docker, x86-64 or arm64): Docker

Elasticsearch version: 7.17.9

Hi,
is it possible to show the full path of the file or, even better, open the containing folder directly in Windows Explorer?
Also: is it possible to search for part of the words? I've noticed that if I search for a portion of the word (even if it's long and unique), it doesn't return any result.
THANKS!!!

@simon987
Copy link
Collaborator

simon987 commented Oct 4, 2023

Hi, where would the full path be displayed? You can click on the file name to have sist2 serve the file from disk.

And you can do partial queries by enabling the "fuzzy" checkbox (elasticsearch only)

@andreapx
Copy link
Author

andreapx commented Oct 4, 2023

Hi, where would the full path be displayed? You can click on the file name to have sist2 serve the file from disk.

Clicking the link downloads the files, it doesn't open it directly from it's path (that would be wonderful!!!

And you can do partial queries by enabling the "fuzzy" checkbox (elasticsearch only)

Oh, I've missed it, thanks!

@simon987
Copy link
Collaborator

simon987 commented Oct 4, 2023

As far as I know, modern browsers will not let you link to local files. And there is no guarantee that the full path is the same for sist2 as for the user (the file could be on a remote computer, network drive etc. Especially with docker)

You can try to set the redirect URL to

file:///path/to/index/root/

@andreapx
Copy link
Author

andreapx commented Oct 4, 2023

the file could be on a remote computer, network drive etc. Especially with docker

Yes, you're right.
A function could be a remapping: the path of the sist2 /path/to/file could be translated and shown to the user as /addedPath/path/to/file. Even if the browser can't open the file, knowing the path it would be easy for the user to go there manually (or copying/pasting it).
Just an idea.

@simon987
Copy link
Collaborator

simon987 commented Oct 5, 2023

And where would this full path be displayed?

@andreapx
Copy link
Author

andreapx commented Oct 6, 2023

And where would this full path be displayed?

Maybe just underneath every single result

@simon987
Copy link
Collaborator

simon987 commented Oct 9, 2023

Implemented in b8c905b (v3.3.5)

You can enable it in Configuration -> featured fields template -> type ${doc.indexRoot}${doc.path}/

image

@simon987 simon987 closed this as completed Oct 9, 2023
@andreapx
Copy link
Author

andreapx commented Oct 9, 2023

WOW, are you serious??? Wonderful!

You know what? I've stopped the container, pulled the latest image and now...I can't reach the front-end.
When I stop it (with the stop button) I see these errors in the logs:

sist2-admin_1    | INFO:     192.168.0.92:54697 - "POST /api/frontend/test/stop HTTP/1.1" 500 Internal Server Error
sist2-admin_1    | ERROR:    Exception in ASGI application
sist2-admin_1    | Traceback (most recent call last):
sist2-admin_1    |   File "/usr/local/lib/python3.10/dist-packages/uvicorn/protocols/http/h11_impl.py", line 429, in run_asgi
sist2-admin_1    |     result = await app(  # type: ignore[func-returns-value]
sist2-admin_1    |   File "/usr/local/lib/python3.10/dist-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
sist2-admin_1    |     return await self.app(scope, receive, send)
sist2-admin_1    |   File "/usr/local/lib/python3.10/dist-packages/fastapi/applications.py", line 276, in __call__
sist2-admin_1    |     await super().__call__(scope, receive, send)
sist2-admin_1    |   File "/usr/local/lib/python3.10/dist-packages/starlette/applications.py", line 122, in __call__
sist2-admin_1    |     await self.middleware_stack(scope, receive, send)
sist2-admin_1    |   File "/usr/local/lib/python3.10/dist-packages/starlette/middleware/errors.py", line 184, in __call__
sist2-admin_1    |     raise exc
sist2-admin_1    |   File "/usr/local/lib/python3.10/dist-packages/starlette/middleware/errors.py", line 162, in __call__
sist2-admin_1    |     await self.app(scope, receive, _send)
sist2-admin_1    |   File "/usr/local/lib/python3.10/dist-packages/starlette/middleware/cors.py", line 92, in __call__
sist2-admin_1    |     await self.simple_response(scope, receive, send, request_headers=headers)
sist2-admin_1    |   File "/usr/local/lib/python3.10/dist-packages/starlette/middleware/cors.py", line 147, in simple_response
sist2-admin_1    |     await self.app(scope, receive, send)
sist2-admin_1    |   File "/usr/local/lib/python3.10/dist-packages/starlette/middleware/exceptions.py", line 79, in __call__
sist2-admin_1    |     raise exc
sist2-admin_1    |   File "/usr/local/lib/python3.10/dist-packages/starlette/middleware/exceptions.py", line 68, in __call__
sist2-admin_1    |     await self.app(scope, receive, sender)
sist2-admin_1    |   File "/usr/local/lib/python3.10/dist-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
sist2-admin_1    |     raise e
sist2-admin_1    |   File "/usr/local/lib/python3.10/dist-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
sist2-admin_1    |     await self.app(scope, receive, send)
sist2-admin_1    |   File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 718, in __call__
sist2-admin_1    |     await route.handle(scope, receive, send)
sist2-admin_1    |   File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 276, in handle
sist2-admin_1    |     await self.app(scope, receive, send)
sist2-admin_1    |   File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 66, in app
sist2-admin_1    |     response = await func(request)
sist2-admin_1    |   File "/usr/local/lib/python3.10/dist-packages/fastapi/routing.py", line 237, in app
sist2-admin_1    |     raw_response = await run_endpoint_function(
sist2-admin_1    |   File "/usr/local/lib/python3.10/dist-packages/fastapi/routing.py", line 163, in run_endpoint_function
sist2-admin_1    |     return await dependant.call(**values)
sist2-admin_1    |   File "/root/sist2-admin/sist2_admin/app.py", line 272, in stop_frontend
sist2-admin_1    |     os.kill(RUNNING_FRONTENDS[name], signal.SIGTERM)
sist2-admin_1    | ProcessLookupError: [Errno 3] No such process

In the 8080 ui is swots it as online.
What could it be?

@simon987
Copy link
Collaborator

simon987 commented Oct 9, 2023

can you check logs/frontend-default.log

@andreapx
Copy link
Author

andreapx commented Oct 9, 2023

When I start the frontend I get this error:
{"stderr": "T0 [2023-10-09 12:10:06] [FATAL cli.c] Index not found: scan-test_job-2023-10-04 05:44:55.037532.sist2\n"}
When I0ve stopped the container I've done it regularly.

@simon987
Copy link
Collaborator

simon987 commented Oct 9, 2023

Try to re-index, for some reason the last_index value is out of sync with the folder (maybe it got deleted?)

@andreapx
Copy link
Author

andreapx commented Oct 9, 2023

Autch, I'll try, last time it took several hours.

@andreapx
Copy link
Author

andreapx commented Oct 9, 2023

It seems that it can't create the index:

[ADMIN ] Starting sist2 command with args ['/root/sist2', 'scan', '/nas_shared/', '--threads=1', '--thumbnail-quality=50', '--thumbnail-count=1', '--thumbnail-size=552', '--content-size=32768', '--output=scan-test_job-2023-10-04 05:44:55.037532.sist2', '--depth=-1', '--archive=recurse', '--mem-buffer=2000', '--incremental', '--name=test_job', '--treemap-threshold=0.0005', '--json-logs', '--very-verbose'] [ERROR ] Invalid value for --thumbnail-quality argument: 50. Must be within [2, 31].
 [ERROR ] free(): invalid pointer
 [ADMIN ] Process returned non-zero exit code (-6)

Should I delete the old one and try again?

@simon987
Copy link
Collaborator

simon987 commented Oct 9, 2023

It's probably because you're upgrading from 3.1.4. There has been a lot of breaking changes, both in sist2-admin and sist2. You will have to delete the sist2-admin folder and start from scratch because unfortunately there are no migration scripts for this version

@andreapx
Copy link
Author

andreapx commented Oct 9, 2023

Ok ok, I'lldo that!
Thanks!

@andreapx
Copy link
Author

andreapx commented Oct 9, 2023

Problem solved after reindexing.
The path right there is phenomenal, very useful. Thanks!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants