-
Posts
141 -
Joined
-
Last visited
Profile Information
-
Gender
Not Telling
-
Location
Canada
Recent Profile Visitors
2,687 profile views
formulate's Achievements
-
@Robin S Ok, I played around with this and can 100% determine that in your code, the following line is causing the issue: 'id.sort' => $merged_ids, The $merged_ids array is in the correct order before finding all the pages using the ids. Once that $pages->find executes with the id.sort, it's messing up the order again based on PW/MySQL's own determination of relevancy for sorting. I guess I could loop through the merged ID's array and grab each one with an individual $pages->get, but that seems ultra wasteful.
-
@Robin S I appreciate you going to this trouble, however it didn't work for me. It's still pages 2 or 3 before I find any product results. I see where you're going with this though and will test and investigate further when I have more time tomorrow. Thanks.
-
@Robin S Ok thanks Robin. Doesn't really address my issue in this case, but good to know this exists as once I get things working the way I want, I'm going to uncap the limits and will need decent performance for the paging.
-
@Robin S I tried your module and all it seems to be doing is the same as $pages->add(). The results from my second selector are just being appended on to the results of the first, not actually merging the two together. I must be doing something wrong? Here's my code: $selectors = [ "productSKU|productModel|productShortName|brand|title|summary|content~=$q,template=product,limit=8", "title|summary|content%=$q,template=video|btt|article|item|case-study|testimonial|diagram,limit=12" ]; $options = [ 'limit' => 20 ]; $results = $pages->findMerge($selectors, $options);
-
DaveP, what you're suggesting is in fact what I'm doing now, or at least close to it. However, I'm having to randomize the combined 10 as I can't figure out how to rank by relevancy between the two arrays. At least I can't see any info regarding relevancy that's returned by PW (maybe I missed it in the arrays). I can live with this solution, so long as I can figure out relevancy ranking with the merged results. It's not ideal and seems like a hack workaround, but it would suffice in this instance. Just seems weird to me that there's no easy way to tell PW that Template A results are more relevant than Template B.
-
Thanks for the suggestions. I don't think I explained myself well enough. I'm really not concerned with pagination at this point. What I'm ultimately trying to achieve is a blend of ranked results from two different templates, but not in the usual "most relevant" sorting method PW uses by default. I still want "Most Relevant" but I want more results to be pulled from Template A than I do Template B. A real simplistic explanation would be something like: for every 2 Template A results, get a Template B result. Not quite literally as 2:1, I still want a variable blend based on relevancy, I just want more results of Template A showing up than B. Some context: I have a website that is both information pages and eCommerce product pages. I want search results to always contain eCommerce products as well as information pages, based on relevancy. My problem is that there are thousands of information pages so when I search for something, those information pages dominate the results and I don't end up seeing an eCommerce product until page 2 or 3 of the results.
-
Not sure how best to go about this and I've tried a few things without success. I'm trying to construct a $pages->find() with a selector that will give preference to a specific template over all others. Ideally I'm trying to get a good mix of "Template A" and "Template B" pages where normally I would just get all Template B results out of thousands of pages even though my specific search terms are part of Template A pages as well. Standard find would be something like: $pages->find("template=templateA|templateB,title*=searchTerm,limit=10") How do I re-do the above to prefer templateB results, but not exclusively?
-
[SOLVED] Float field type problems more than 6 numbers
formulate replied to formulate's topic in Getting Started
Totally agree to this. I imagine most common case-use scenarios would be for using Decimal rather than Float. Given the additional confusion with Float and how the numbers get manipulated (which isn't readily clear anywhere that I could see), it definitely seems like Float should not be the default option that's installed. -
[SOLVED] Float field type problems more than 6 numbers
formulate replied to formulate's topic in Getting Started
Oh, just figured out there's a "Decimal" fieldtype in the core that isn't installed by default. This looks like it will do the trick. Thanks everyone. -
[SOLVED] Float field type problems more than 6 numbers
formulate replied to formulate's topic in Getting Started
Ok, so this is getting over my head a bit. My numbers are not scientific notation, I just want a way in PW to be able to specify a 7 or 8 digit number, possibly with 2 decimal places and have it not manipulated in any way. I guess I could just use a text field, but that defeats the purpose. -
Created a new float field and it is converting any numbers past the 6th to zero. Example: I enter 123456789 in to the field and after saving the number is 123456000. I have checked and ensured the character limit is set to it's default "10". I also tried "0" and "999". None of that worked. PW version 3.0.184 SOLUTION: use the "Decimal" fieldtype that is built in to the core. It's not installed by default, you need to enable it in Modules > Core.
-
I did get it working! It took A LOT of time and money, but I eventually got it working. Their documentation is A) terrible and even B) misleading. I'll shoot you a message and we can pick this up in email (it'll be easier that way).
-
Yes I've tried it with and without $raw_output. 'website' really is the API username.
-
I'm at the end of my rope! I've been trying to use a 3rd party API that requires authorization. I've tried a zillion different ways in both cURL and wireHTTP. cURL always tells me the signature is wrong. wireHTTP returns 401 unauthorized. Here's the brief documentation for authorization with the API: https://integrate.spektrix.com/docs/authentication Here's the latest version of my wireHTTP code: $date = date(DATE_RFC1123); $string = "GET\n/sidwilliams/api/v3/customers/I-KS22-363P/\n$date"; $string = utf8_encode($string); $key = base64_decode('XXXX'); $signature = base64_encode(hash_hmac('sha1', $string, $key)); $http = new WireHttp(); $http->setHeader('Host', 'system.spektrix.com'); $http->setHeader('Date', $date); $http->setHeader('Authorization', 'SpektrixAPI3 website:' . $signature); $response = $http->get('https://system.spektrix.com/sidwilliams/api/v3/customers/I-KS22-363P/'); if($response === false) { echo $http->getError(); }else{ echo $response; } If anyone is interested in seeing my cURL, I can post that too. Thanks!
-
Thanks to both of you for the feedback. Maybe I'm approaching this wrong. All I'm storing is time stamps. There's a hierarchical organization of pages and within these, a need to store time stamps. I considered JSON at a lower sub-level of pages, but even then, the JSON would get too large for the MySQL character limit for the text field. Also, the JSON would become time consuming to process and work with. Is there a better way of storing millions of time stamps that I'm not thinking of?