-
Posts
378 -
Joined
-
Last visited
-
Days Won
1
Everything posted by MuchDev
-
Ha, good point. No. Well now that I think of it they may need pro cache access. Meh who cares, disregard
-
Hey there, I have a little issue with icons not displaying in my admin screen for my site. This issue has existed for me ever since I did a upgrade several months ago, but I just haven't bothered to try and track it down. I am now getting a lot closer to going live and want to start letting the client in, and having these icons I think may help a little bit for them to identify menus. I have tried doing a full copy and overwrite all of the wire directory, but this does not fix the issue. I am not showing any 404's in my dev view. Any ideas?
-
Alright, I'm going to try running cgi as the handler for a while and see how well it performs. If there are no issues I suppose I could just use this. I found some more info on the forum on the subject and I see now that there are quite a few people who have had issues with their hosting and fcgi. https://processwire.com/talk/topic/4524-fresh-install-mod-rewrite-and-apache-as-fastcgi/
-
This is interesting, I would really like to see if there were some tweaks I could apply to my set up to get things processing faster. I just went digging again through cPanel and whm and there are a multitude of settings panels I could tweak with the propper documentation. According to some forum posts it looks as if my install is already a tweaked version of centos so I will need to approach any modifications with this knowlege in hand. Ahh the joys of learning, it never gets old .
-
Thank you for your post, this is really helpful information, I did see that post before but missed what you guys were talking about when I read it initially. Good to know about the etiquette, I always feel like I’m doing it wrong J. Sorry for the limited info also I supplied all I could see out of that very vague error that the server gave me. I was actually surprised how vague the error was, I’m used to seeing errors that are considerably more detailed and not in red . After staring at the error and reading your previous posts on the other page it is now a bit more obvious that my problem is due to a timeout issue with the server running into its 30 sec time limit for processing a page the first time. My images are limited by their current web guy to 1200px wide proportionately, therefor the largest image that we have so far is around 900kb-1mb. Most pages have a 30 item limit in the get and are then paginated. The server itself is a vps through bluehost, so the specs are : Dual Core Opteron 6376 (2.2hgz) 512k cache Memory: 1901912k/2097140k available (5330k kernel code, 408k absent, 194820k reserved, 7009k data, 1280k init) Centos 6.5 As far as the deeper settings I must first admit that this is my first foray into linux server administration, but I did some digging and my php handler is set to fcgi. Everything came pre-installed and configured when I set the server up initially. Is this something that I could view through WHM? That is really a cool tweak for the image module I didn't understand that the function was forcing the creation of derivative images, but as this is paid hosting I feel wary of increasing the image footprint and have to force the customer to pay for extra storage, I foresee this site ending up with around 30-40,000 items / images + derivatives. All in all, it looks like I may need you to help me to help you so you can help me .
-
Hey there, so I figured someone would know how to solve this simply. I have seen some posts that get close to what I am working towards, but instead of bumping old solved posts I figured I would open a fresh one. I have thousands of images that I would like to pre-cache the derrivitave images for. Currently I think I am running into memory issues with the image resizer as the images are having to cache every time I load a page for the first time. A lot of the time I am getting this error: Error: Maximum execution time of 30 seconds exceeded (line 1393 of /home/swflemin/public_html/dg/wire/core/ImageSizer.php) This error message was shown because you are logged in as a Superuser. Error has been logged. Administrator has been notified. Is there any way to run an update on a image field so that these images get cached ahead of time? Or should I just use a site spider to force it to cache the images? Maybe this would be a good mod to add to an image field like alternate resolutions so that the server doesnt have to try and load them jit. if ($gridSizer == "1"){ $gen .='<div class="cards col-lg-3 col-md-4 col-sm-6 col-xs-12">'; $width = 400; }elseif($gridSizer == "2"){ $gen .='<div class="cards col-lg-6 col-xs-12">'; $width = 550; }elseif ($gridSizer == "3"){ $gen .='<div class="cards col-lg-9 col-xs-12">'; $width = 825; }elseif ($gridSizer == "4"){ $gen .='<div class="cards col-xs-12">'; $width = 1105; }else{ $gen .='<div class="cards col-lg-3 col-md-4 col-sm-6 col-xs-12">'; $width = 400; } $thisItem->artwork_img->width($width)->url; Here is my logic, most images will be resized from around 1200 to 400. There is a selector on each item that lets the user decide the image size.
-
*edit* I managed to speed up the query significantly by changing my query operator to ~= instead of %=. I guess the documentation was right about speed. So I fiddled and I fiddled to get reliable results that combine partial text, multiple words, and multiple fields all in one search. Here is what I came up with. // Send our sanitized query 'q' variable to the whitelist where it will be // picked up and echoed in the search box by the head.inc file. $input->whitelist('q', $q); //separate out words in query and iterate them $queryWords = explode(" ",$q); //build query $wordcount = count($queryWords); foreach ($queryWords as $word){ $wordcount--; if ($wordcount>0){ $sep = ','; }else{ $sep = ''; } $sr1 = ''; $sr2 = ''; $sr3 = ''; $sr1 = "title|"; //if word is not a number then query contemporary_artist_selection page field if (!is_numeric($word)){ $sr2 = "contemporary_artist_selection|"; } $sr3 = "search_fields"; //was using %= to search but found search times too slow. $query.= "$sr1$sr2$sr3~=$word$sep"; } //query built, now find and spit errors for debugging try{ $matches = $pages->find("$query,limit=20"); }catch(Exception $e){ echo $e."\n\nThere has been an error \n Query:$query"; } $count = $matches->getTotal();
-
Thank you I looked everywhere and couldn't find anything on the subject. I was under the assumption that I had just configured something incorrectly. Everything is working perfectly now thanks to your guidance. You are a good man Soma! As a side note I just wanted to thank you for creating your ajax progressive search module. I have been using it to show results on my site and it looks amazing. It works so well for image results, I really couldn't ask for anything more. Cheers!
-
So for some reason this method is really fighting me. I have been fiddling with different ways to make the cache field pick up my page field that I use to define an artist in an artwork. So far I have tried enabling autojoin and also have tried to create a new cache field that just caches this field as well. I am going to try another page field type and see if something else will work. **edit** Ok so I am still not sure why this page field is not caching but I have just decided to work around it by including the field name in the query. I like the idea of only using a cache field to generate results though, and look forward to any tips on how to get this up and running
-
Following your advice I have implemented a cache field that holds all of the fields that I want to query. I am running into an issue though where I am not returning any results from a page field when I search using the cache field. Is this a limitation of the module, a setting issue, or something I am doing wrong. This should work with page fields correct? $matches = $pages->find("search_fields%=$q");
-
I thank you Soma for taking time to respond to my questions and LostKobrakai for giving some good feedback on my selectors. That is a fantastic bunch of info that you have provided, and really does help me to understand the platform and the methods that I will need to employ to complete this. This is just a general search before I get to any filtering or sorting. This search just needs to return a more complete and less filtered result list that holds items that are just generally associated to the query. Mostly what I see that people will search for is something like Artist Name | Artwork Name or Artist Name | Medium or even just a search for Tag. From here they would filter their search based on department, year,price,medium. The reason that I have used so many fields is mostly due to the fact that I am also creating descriptions specific to the templates, so that a very basic user would be able to interact and understand what they had to enter in order to make an item display on the site, I also am working with another developer friend and wanted to try and keep the variables in a naming convention that they would hopefully be able to intuit their meaning easier. The data that I would like to be searchable is pretty basic as it would mostly be just the items themselves, and all of their relevant metadata. About 80% of this site will be this template (items): title contemporary_artist_selection - links item to their artist. As items may be in different parents or sections the artist will be selected using a page field so that it can be located globally. artwork_year artwork_ed artwork_medium artwork_dimensions artwork_price artwork_sale_information Tags artwork_description gridSizer - used for markup and will not need to be searchable artwork_img - used for markup and will not need to be searchable meta_description meta_keywords So now at I'm a bit of a php noob so I didn't realize that this was not going to work, good to know . I suppose I would have gotten here in the end, but I really appreciate you helping me on this. This is when I get to the EUREKA moment. Your suggestion would be perfect for this. I could create a cache field that held all of these fields in one field and just reference it for my search! So now to look into creating this functionality and using this instead of trying to search the specific fields in the beginning. I can then run more specific searches based on user input. You Soma are a GENIUS.
-
Ok so I have managed to get a pretty good list of results going. All my pages are now showing up . Now I am on to sorting based on relevance. I have a couple things that I would like to implement but I could really use some input on. First off lets start with my code. //use field template to create list of fields //separate out words in query and iterate them $queryWords = explode(" ",$q); $matches = $pages->find("title*=$q,has_parent!=2,template!=404"); //$matches = $pages->find("{$allFields}body*=$q,has_parent!=2,template!=404"); foreach ($queryWords as $word){ if (count($word)>3){ foreach ($templates->get("fields")->fields as $field){ if (!$matches) $matches = new PageArray(); try { $partialResults = $pages->find("{$field}%=$word,has_parent!=2,template!=404"); } catch(Exception $e) { break; } $matches->append($partialResults); } } } In my code I have referenced a template that I have created with a big list of fields. 1. title 2. artist_firstname 3. artist_lastname 4. artist_nationality 5. artist_biography_snippet 6. artist_biography 7. artwork_dept 8. artwork_year 9. artwork_ed 10. artwork_dimensions 11. artwork_pricePrice 12. artwork_medium 13. Tags 14. antique_artist 15. artwork_condition 16. artwork_printer 17. artwork_series 18. artwork_references 19. artwork_publisher 20. artwork_provenance 21. artwork_description 22. artwork_signature 23. publication_title 24. publication_subtitle 25. publication_medium 26. publication_medium_detail 27. publication_date 28. publication_dimensions 29. publication_description 30. publication_price 31. publication_type 32. subsection_description All of these are referenced and then searched against. This seems like way too much overhead but I can't think of any other way as this site will be very textbox heavy. What I would like to come up with is a method to prioritize results and sort them based on relevance and maybe a simple method to cross reference the results. Also I was wondering if there was a php or processwire method that anyone knew about that would be able to determine weather a word was a stopword I would then use that in my find loop
-
Out of curiosity has anyone tested this with 2.5? I am wondering if there is an issue with the module or my configuration, im not seeming to get any results when I index.
-
Well I was really close. Here is what I came up with. //use field template to create list of fields //separate out words in query and iterate them $queryWords = explode(" ",$q); foreach ($queryWords as $word){ foreach ($templates->get("fields")->fields as $field){ if (!$matches) $matches = new PageArray(); try { $partialResults = $pages->find("{$field}%=$word,has_parent!=2,template!=404"); } catch(Exception $e) { break; } $matches->append($partialResults); } } Any suggestions? Everything seems to be working correctly. I am now fetching a boatload of results. Maybe even too many.
-
So I've studied some other's code and something like this seems to be what I am wanting. I will break the words off and search them, at that point I will add the results to the search array. This still is not working for some reason though. $queryWords = explode(" ",$q); foreach ($queryWords as $word){ foreach ($templates->get("fields")->fields as $field){ if (!$matches) $matches = new PageArray(); $partialResults = $pages->find("{$field}%=$word,has_parent!=2,template!=404"); $matches->append($partialResults); } }
-
That was very helpful. My search is no longer breaking. Now I am on the right track. So in order to run a query that would locate an item based on partial text in different fields then what operator would I use. For instance a template record which has this information Title : Fabulous artwork year: 1999 medium: Lithograph description: This description has a keyword in it as well like Paris Let's suppose that a user entered the query into the search : Paris lithograph 1999 or artwork lithograph. Would this search be able to be executed in one shot or would I have to run a partial search on each keyword and then re-search the records for the next keyword in line? Well it looks as if I have more reading to do. I googled a bit more and found an old post about combining fields in a search. This hopefully will allow me to get a better result list. https://processwire.com/talk/topic/4860-selector-match-that-mixes-multiple-fields/
-
This is a good point, after reviewing all of the fields that I have added there are some non text fields ie:datetime, repeater, and page. I am a bit green when it comes to database work, so I misunderstood what the documentation was refering to about what a full text search is. Is it possible to run a text search on repeater and datetime fields, or will this have to be done via another method?
-
Well after hours of reading I think that I may just not be able to query this data properly using only the built in mysql search features. For this reason I have gone and installed ElasticSearch on my server. Now just to figure out how to get it talking to processwire. So far I have it installed and running and returning its default record. It seems like the module is working but then it doesnt index anything.
-
Hey thanks, that is much cleaner I didn't thing about being able to fetch the template fields without using a page . foreach ($templates->get("fields")->fields as $field){ $allFields .= $field.'|'; } $matches = $pages->find("{$allFields}body%=$q,limit=50,has_parent!=2,template!=404"); Search is still broken though when I try and use a ~= selector though. Also this query will not find results that contain text on multiple fields.
-
I have been working on this logic off and on lately and have made some progress. The original question has been answered/fixed. Now I am on to making my search results make more sense. See from post #11 for new content. ---------------------------------------------------------------------- I fear I am a bit out of my depth on this one. I have been trying to get a site search up on an art gallery site that I am developing. I have created a template that has all of the fields in all of the templates on my site that I want to search against. From this list I am wanting to generate my search query. When I try and run a fulltext query based on these templates I get a big error. Error: Exception: SQLSTATE[HY000]: General error: 1191 Can't find FULLTEXT index matching the column list //use field template to create list of fields foreach ($pages->get("/search-engine-fields/")->fields as $field){ $allFields .= $field.'|'; } $matches = $pages->find("{$allFields}body~=$q,limit=50,template!=admin,template!=permission,template!=user"); I have attempted using %= but then I am unable to locate items which have segments that contain the terms. Is there another method that I should employ?
-
Best way to implement a global utility function?
MuchDev replied to jordanlev's topic in Getting Started
As a noob I put includes in my header that is included on every page. Hadn't thought about including in the config. -
One thing that has happened to me is if there is an error that has not shown then processwire halts rendering which in turn doesn't render my footer. If a footer doesn't render there goes your jquery if thats where your jquery is. Were you logged in as su when you were debugging out of curiousity?
-
I would focus on the jquery and the css to make sure positioning of the menu isnt causing the large image to push the div out of the way. Is there any issues/errors (firebug or devtools)? Maybe an open div tag or a duplicate id..?
-
Combining pages from multiple page select and children (limit=xx)
MuchDev replied to MuchDev's topic in General Support
One more while I'm at it. In order to locate this page based on the items that are contained within the pagefield will I need search for the page or can I just search by the included pages ID? -
Combining pages from multiple page select and children (limit=xx)
MuchDev replied to MuchDev's topic in General Support
So this is working pretty much as planned, but what I am wondering now is this. I am currently using logic to separate out the items once they have been fetched. I am grabbing all children of the page but some of the children have their own children that I then loop over. I feel that I should change this to a more simple selector that grabs all items including children before I loop them. Any thoughts? Here is the more final code, I still have to implement pagination better but I have a working test elsewhere. (I've stripped most of the markup out to make the code as readable as I could manage) $inventoryItems = $page->Artwork_in_Inventory; $items = $inventoryItems; $items->import($page->children); $items->setLimit(35); //social dropdown and pagination menu echo '<div class="pageNavTop">'; echo '<div class="socialHolder">'; echo renderSocial(); echo '</div>'; echo $items->renderPager(array( 'listMarkup' => "<ul class='pagination pageNavBtns'>{out}</ul>", 'currentItemClass' => "active")); echo '<div class="hrHolder">'; echo '<hr/>'; echo '</div>'; echo "</div>"; foreach($items as $item){ $generated = false; //Remember to not return any tags in the string if no information has been returned. //option 1 - one is an item and then just print it. if ($item->template->name === 'items'){ $gridSizer = $item->gridSizer; echo generateItem($item,$gridSizer); $generated = true; } //option 2 is a subsection. Print 100%width divider with text areas if ($item->template->name === 'itemsSection'){ echo "<div class='grid-item masonrySection col-xs-12'>"; //echo $item->gridSizer; //echo "<h2>{$item->title}</h2>"; if ($item->subsection_description){ echo "<p>{$item->subsection_description}</p>"; } echo "</div>"; foreach ($item->children() as $subitem){ $gridSizer = 1; if ($subitem->gridSizer){ $gridSizer = $subitem->gridSizer; } echo generateItem($subitem,$gridSizer); } } }