Jump to content
  • 0

Slowing Group search


Yelay12
 Share

Question

When i search as groupsearch,I get results is slower than normal search.

Can i search as twice this two value and do offset with offset distance.

if i know this two values and offset distance.How to write my script instead of group search. Please help with your great experience.

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

What are the values? How many search results do you get when searching the values separately (i.e. new search for first value in desired ranges - X results, same for second value - Y results)? What is the offset between the values? Which option will work better for your case can be estimated only with knowledge of the details.

Link to comment
Share on other sites

  • 0
Posted (edited)
5 hours ago, CmP said:

What are the values? How many search results do you get when searching the values separately (i.e. new search for first value in desired ranges - X results, same for second value - Y results)? What is the offset between the values? Which option will work better for your case can be estimated only with knowledge of the details.

My values are first is 210 and second is 30 TYPE_DOUBLE each. Offset distance between these values is 12 decimal number.X searching results for first will be approximately 500 and Y results for second get probably approximately 300 results.These results are not same one time to another time.Resultscount can be change every time. Please can you help me for this case.

Edited by Yelay12
Link to comment
Share on other sites

  • 0

Then it's reasonable to just search either first or second value and filter only desired results that have other value at needed offset. Something like the following: 

local firstValue = 210.0
local secondValue = 30.0
local offset = 12

gg.clearResults()
gg.searchNumber(firstValue, gg.TYPE_DOUBLE)
local firstValues = gg.getResults(gg.getResultsCount())
local secondValues = {}
for i, v in ipairs(firstValues) do
  secondValues[i] = {address = v.address + offset, flags = gg.TYPE_DOUBLE}
end
secondValues = gg.getValues(secondValues)
local targetResults = {}
local index = 1
for i = 1, #firstValues do
  if secondValues[i].value == secondValue then
    targetResults[index] = firstValues[i]
    targetResults[index + 1] = secondValues[i]
    index = index + 2
  end
end
gg.loadResults(targetResults)
Link to comment
Share on other sites

  • 0
21 hours ago, CmP said:

Then it's reasonable to just search either first or second value and filter only desired results that have other value at needed offset. Something like the following: 

local firstValue = 210.0
local secondValue = 30.0
local offset = 12

gg.clearResults()
gg.searchNumber(firstValue, gg.TYPE_DOUBLE)
local firstValues = gg.getResults(gg.getResultsCount())
local secondValues = {}
for i, v in ipairs(firstValues) do
  secondValues[i] = {address = v.address + offset, flags = gg.TYPE_DOUBLE}
end
secondValues = gg.getValues(secondValues)
local targetResults = {}
local index = 1
for i = 1, #firstValues do
  if secondValues[i].value == secondValue then
    targetResults[index] = firstValues[i]
    targetResults[index + 1] = secondValues[i]
    index = index + 2
  end
end
gg.loadResults(targetResults)

Thank you very very much.I'm finding that script.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.