Skip to content

Conversation

@tcnichol
Copy link
Contributor

@tcnichol tcnichol commented Mar 8, 2024

This pull request will enable a search of public data for non-logged in users.

It also fixes a problem. When a logged in user would search, public and authenticated matches were not being shown. In the query 'public' and 'authenticated' had to be in all lowercase. Additionally, not all files were having their status updated when the dataset changed. This is also fixed.

To test, create datasets. Make sure some are public and authenticated.

If no user is logged in, public datasets and files should show up in search results.

If a user is logged in, public and authenticated datasets and files should show up in search results, along with their own items or datasets explicitly shared.

Changing the status of a dataset should be reflected in search results.

@tcnichol tcnichol linked an issue Mar 8, 2024 that may be closed by this pull request
@tcnichol tcnichol requested a review from ddey2 March 8, 2024 20:40
Copy link
Member

@ddey2 ddey2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tcnichol I can see the public datasets in the dropdown list for public search. But when I click enter or click on any of the dataset form the dropdown list, it doesn't take me to the search result page or the dataset page itself.
Screenshot 2024-03-11 at 3 31 35 PM

@tcnichol
Copy link
Contributor Author

@tcnichol I can see the public datasets in the dropdown list for public search. But when I click enter or click on any of the dataset form the dropdown list, it doesn't take me to the search result page or the dataset page itself. Screenshot 2024-03-11 at 3 31 35 PM

I think I have fixed this. I noticed that in the search results the links were not for public_datasets or public_files, they were the same as for logged in search. I added a PublicSearchResult component which should fix these issues.

unused imports
Copy link
Member

@longshuicy longshuicy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Public search works.
Regular Search now also includes public information.
One mis-match i noticed is:

  • Public search found an item
  • Click link of that item leads to the wrong url
    e.g.
http://localhost:3000/public/datasets/65e0cd7d97540f9ae8425eba
vs
http://localhost:3000/public_datasets/65e0cd7d97540f9ae8425eba
image

@tcnichol
Copy link
Contributor Author

@longshuicy

I checked and the search result links should be fixed for public search now, for both files and datasets.

@tcnichol tcnichol requested a review from longshuicy March 28, 2024 17:28
@lmarini lmarini requested a review from ddey2 April 11, 2024 14:19
Copy link
Member

@ddey2 ddey2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rest looks good to me. Once you import SearchDatasetIcon, public search works.

@ddey2
Copy link
Member

ddey2 commented Apr 16, 2024

@tcnichol Clicking on the link after the search doesn't work. Clicking on the dataset takes you to the main page.
Screenshot 2024-04-16 at 2 39 53 PM

@ddey2 ddey2 self-requested a review April 16, 2024 19:41
Copy link
Member

@ddey2 ddey2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left comment

@tcnichol
Copy link
Contributor Author

@ddey2 I noticed that there was an inconsistency in the routes for public_datasets. Some spots had public/datasets instead. Went through and I think I fixed that.

Though now the link to the public search is broken at the top of the Public page, working on that.

@lmarini lmarini requested a review from ddey2 April 18, 2024 14:49
Copy link
Member

@ddey2 ddey2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

Copy link
Member

@longshuicy longshuicy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Public search seems to be able to match dataset, not files though. Might be your clause is specifically matching dataset status. Not sure how to get around, but at least I would change the label Search for Datasets and Files
image

@longshuicy
Copy link
Member

@tcnichol any chance you have addressed public files not searchable issue? If it is challenging, could you create another issue to address that separately? The rest of this PR looks good.

@tcnichol
Copy link
Contributor Author

@tcnichol any chance you have addressed public files not searchable issue? If it is challenging, could you create another issue to address that separately? The rest of this PR looks good.

Let me check. I think it should be fixed because the problem was that the fields for public or authenticated were null for files in elasticsearch, but that should be fixed now. I'll make sure it is working.

@lmarini
Copy link
Member

lmarini commented Jun 3, 2024

@tcnichol any chance you have addressed public files not searchable issue? If it is challenging, could you create another issue to address that separately? The rest of this PR looks good.

Let me check. I think it should be fixed because the problem was that the fields for public or authenticated were null for files in elasticsearch, but that should be fixed now. I'll make sure it is working.

@tcnichol is this fixed now? Thanks.

Copy link
Member

@longshuicy longshuicy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After drop volume and restart, elasticsearch is indexing properly and I can search for files. Approved.

@longshuicy longshuicy merged commit 2380be5 into main Jun 3, 2024
@longshuicy longshuicy deleted the 836-public-search-option branch June 3, 2024 20:03
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

Successfully merging this pull request may close these issues.

public search option

5 participants