-
Notifications
You must be signed in to change notification settings - Fork 189
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
Fixes SearchResults not displaying posts when searching #2012
Conversation
@@ -56,7 +56,7 @@ type SearchResultProps = { | |||
const SearchResults = ({ text, filter }: SearchResultProps) => { | |||
const classes = useStyles(); | |||
const prepareUrl = (index: number) => | |||
`${telescopeUrl}/query?text=${encodeURIComponent(text)}&filter=${filter}&page=${index}`; | |||
`${postsServiceUrl}/query?text=${encodeURIComponent(text)}&filter=${filter}&page=${index}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A lot of our current config URLs deal with adding the end-point (i.e., /query
), see https://github.com/Seneca-CDOT/telescope/blob/master/src/web/src/config.ts#L15-L18. I wonder if we should do the same, so you'd do:
${postsServiceUrl}?text=${encodeURIComponent(text)}&filter=${filter}&page=${index}
;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another question: why are we doing a search (/query) at the posts URL?
@@ -56,7 +56,7 @@ type SearchResultProps = { | |||
const SearchResults = ({ text, filter }: SearchResultProps) => { | |||
const classes = useStyles(); | |||
const prepareUrl = (index: number) => | |||
`${telescopeUrl}/query?text=${encodeURIComponent(text)}&filter=${filter}&page=${index}`; | |||
`${postsServiceUrl}/query?text=${encodeURIComponent(text)}&filter=${filter}&page=${index}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another question: why are we doing a search (/query) at the posts URL?
I done goofed up here. This PR should be switching to the ElasticSearch microservice url, not the posts microservice url. ELK is used here to index posts. This PR will have to either be closed, or wait until #1802 is merged |
Filed #2014 to successfully link to this issue. This issue can also deal with moving the search service to production/staging since that'll also be needed for the frontend to work |
You haven't dealt with my review comments, are you planning to fix? If not, let's close this. |
This is waiting on #1802. We need the Search service in place before we can update this URL. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did your actual changes get lost here?
They did, it's nothing minor since the change I made did not work, but I do need to fix the history here as well |
What's going on with this? Think we can get it for today's release? |
Issue This PR Addresses
No issue was made for this PR
Type of Change
Description
This PR addresses the SearchResults page not properly displaying posts. This page originally used the telescopeURL, which was the original backend url used here. I switched the url to the new posts service url, which will correctly pull in the search microservice url. This bug was found when debugging #1910 and should hopefully help frontend developers working on the frontend search related components
Checklist