-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
check ranking command and jobs #82
Conversation
src/Models/Keyword.php
Outdated
@@ -23,6 +24,11 @@ protected static function boot() | |||
static::saving(function ($keyword) { | |||
$keyword->phrase = strtolower($keyword->phrase); | |||
}); | |||
|
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.
Are we sure we want to add this as a global scope? It seems like this should just be a customer query builder or local scope since the user is going to want to see their inactive keywords somewhere
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.
I was trying to do it like the locations package. But I think you are allowed to do something like static:: withoutGlobalScope('active')->get() right?
- add active scope to keyword model - add check keyword rankings commands - add shorcuts to actions inside of keyword and ranking models - update CheckRankingCommand.php to use action - add an exception to GetOrganicResults.php so we know when it doesn't return any data - add setActive method to Keyword, which updates appropriate date fields
@@ -14,6 +14,7 @@ public function up() | |||
$table->id(); | |||
$table->string('phrase')->index()->unique(); | |||
$table->string('type')->index(); // Example: 'Branded', 'Generic', 'Local' | |||
$table->boolean('is_active')->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.
I would prefer to not have this in the database. Can we just create a scope for the active keywords based on the datetime fields for tracking_requested_at
and tracking_stopped_at
?
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.
Yes I will put that back.
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.
Thanks!
Let's discuss with the team and we may want to add this back if there are performance gains.
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.
Sorry @drewroberts I had asked Arwa to add this since we are going to be using that active scope for everything in regards to keywords. Yes I was thinking it would be better for performance but that just depends on how big the keyword database will get. If it's not going to get that big then it probably wouldn't make much of a difference. I am curious to know the others' opinions on it though.
@@ -22,7 +22,7 @@ public function up() | |||
|
|||
// Don't need timestamps since can use created_at timestamp of the ranking class | |||
|
|||
$table->unique(['ranking_id', 'type', 'position'], 'result_unique'); | |||
//$table->unique(['ranking_id', 'type', 'position'], 'result_unique'); |
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.
I don't think sitelinks should prevent the use of unique results. They should have a different type value.
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.
I am not sure I understand. All the sitelinks of a website would have the same ranking id and position which they would get from the parent webpage. Should we have a "Sitelink" type enum for the "type" column? But even so, all sitelinks would have that same type. So the combination of the 3 would still be duplicated for the sitelinks.
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.
OK, I'm going to push this through and then let's take a look at how it runs in a Zoom meeting and I'll know more then what we should do. My thought is that I want to know what order the sitelinks are in. They should have a parent_id of the main result and be a different type with their own ranking.
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.
CC: @joshtorres @phuclh
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.
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.
Let's run some examples on their website and see if the key matches the order in which they are shown in the search results.
$table->id(); | ||
$table->foreignIdFor(app('keyword'))->index(); | ||
$table->foreignIdFor(app('search_locale'))->index(); | ||
$table->timestamps(); |
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.
Let's add creator & updater to this so we know who added them.
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.
👍
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.
Thank you! 🚎
I'm excited to see this code in action with our SerpAPI key. It looks great and I look forward to a demonstration to see it in action.
Would appreciate some feedback to see what needs to be changed. Thanks!