Skip to content

Conversation

@MQ37
Copy link
Contributor

@MQ37 MQ37 commented May 5, 2025

closes #71

Currently there is issue where Google SERP sometimes returns suggested results and sometimes not for some reason. We need to investigate, but when the Google returns them we are returning them successfully.

@github-actions github-actions bot added the t-ai Issues owned by the AI team. label May 5, 2025
@MQ37 MQ37 marked this pull request as ready for review May 6, 2025 07:19
@MQ37 MQ37 requested a review from Copilot May 6, 2025 07:19
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses issue #71 by ensuring that suggested results are returned when present and by adding a new property, resultType, to dataset items.

  • Introduces a new SearchResultType union in src/types.ts and updates OrganicResult to include an optional resultType property.
  • Updates scrapeOrganicResults in src/google-search/google-extractors-urls.ts to consistently populate resultType as either 'SUGGESTED' or 'ORGANIC' based on suggestion detection.

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/types.ts Added SearchResultType and resultType field to OrganicResult to distinguish between result types.
src/google-search/google-extractors-urls.ts Modified scrapeOrganicResults to map deduplicated results with the appropriate resultType for each case.
Files not reviewed (1)
  • .actor/actor.json: Language not supported
Comments suppressed due to low confidence (1)

src/google-search/google-extractors-urls.ts:81

  • [nitpick] The mapping logic for assigning resultType is duplicated in both branches; consider refactoring this mapping into a helper function to improve code maintainability.
return deduplicatedResults.map((result) => ({ ...result, resultType: 'SUGGESTED' }));

@MQ37 MQ37 requested a review from jirispilka May 6, 2025 07:20
Copy link
Collaborator

@jirispilka jirispilka left a comment

Choose a reason for hiding this comment

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

Thanks, looks good!

@MQ37 MQ37 merged commit 2fc2a69 into master May 6, 2025
2 checks passed
@MQ37 MQ37 deleted the fix/suggested-results branch May 6, 2025 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-ai Issues owned by the AI team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot handle quotes in search term

2 participants